mirror of
https://github.com/aljazceru/mcp-python-sdk.git
synced 2025-12-19 14:54:24 +01:00
Add instructions field to InitializeResult
This commit is contained in:
@@ -285,6 +285,8 @@ class InitializeResult(Result):
|
|||||||
"""The version of the Model Context Protocol that the server wants to use."""
|
"""The version of the Model Context Protocol that the server wants to use."""
|
||||||
capabilities: ServerCapabilities
|
capabilities: ServerCapabilities
|
||||||
serverInfo: Implementation
|
serverInfo: Implementation
|
||||||
|
instructions: str | None = None
|
||||||
|
"""Instructions describing how to use the server and its features."""
|
||||||
|
|
||||||
|
|
||||||
class InitializedNotification(Notification):
|
class InitializedNotification(Notification):
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ async def test_client_session_initialize():
|
|||||||
prompts=None,
|
prompts=None,
|
||||||
),
|
),
|
||||||
serverInfo=Implementation(name="mock-server", version="0.1.0"),
|
serverInfo=Implementation(name="mock-server", version="0.1.0"),
|
||||||
|
instructions="The server instructions."
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -92,6 +93,7 @@ async def test_client_session_initialize():
|
|||||||
assert result.protocolVersion == LATEST_PROTOCOL_VERSION
|
assert result.protocolVersion == LATEST_PROTOCOL_VERSION
|
||||||
assert isinstance(result.capabilities, ServerCapabilities)
|
assert isinstance(result.capabilities, ServerCapabilities)
|
||||||
assert result.serverInfo == Implementation(name="mock-server", version="0.1.0")
|
assert result.serverInfo == Implementation(name="mock-server", version="0.1.0")
|
||||||
|
assert result.instructions == "The server instructions."
|
||||||
|
|
||||||
# Check that the client sent the initialized notification
|
# Check that the client sent the initialized notification
|
||||||
assert initialized_notification
|
assert initialized_notification
|
||||||
|
|||||||
Reference in New Issue
Block a user