Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Empty tools list when calling tools/list method #1030

Open
@sunishsheth2009

Description

@sunishsheth2009

Question

When client calls the server with:

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/list",
  "params": {
    "cursor": "optional-cursor-value"
  }
}

If there are no tools returned back for that server then the expected response that the client looks for is:

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "tools": [],
  }
}

But if we look at the json serialization spec from proto, it expects that tool is not added as part of the response.
So the standard serialization would return back something like this:

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": { }
}

But we get an error from client

pydantic_core._pydantic_core.ValidationError: 1 validation error for ListToolsResult\n      | tools\n      |   Field required

Wondering if we can follow the protobuf spec and not expect the tools to be present?
Thank you.

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions