fix: replace http code by jsonrpc (#1920)
This commit is contained in:
parent
213cf993ca
commit
656f887aff
2 changed files with 7 additions and 13 deletions
|
|
@ -281,10 +281,7 @@ class StreamableHTTPSessionManager:
|
|||
error_response = JSONRPCError(
|
||||
jsonrpc="2.0",
|
||||
id="server-error",
|
||||
error=ErrorData(
|
||||
code=INVALID_REQUEST,
|
||||
message="Session not found",
|
||||
),
|
||||
error=ErrorData(code=INVALID_REQUEST, message="Session not found"),
|
||||
)
|
||||
response = Response(
|
||||
content=error_response.model_dump_json(by_alias=True, exclude_none=True),
|
||||
|
|
|
|||
|
|
@ -50,12 +50,7 @@ def validate_sampling_tools(
|
|||
"""
|
||||
if tools is not None or tool_choice is not None:
|
||||
if not check_sampling_tools_capability(client_caps):
|
||||
raise McpError(
|
||||
ErrorData(
|
||||
code=INVALID_PARAMS,
|
||||
message="Client does not support sampling tools capability",
|
||||
)
|
||||
)
|
||||
raise McpError(ErrorData(code=INVALID_PARAMS, message="Client does not support sampling tools capability"))
|
||||
|
||||
|
||||
def validate_tool_use_result_messages(messages: list[SamplingMessage]) -> None:
|
||||
|
|
|
|||
Loading…
Reference in a new issue