Skip to content

Add "meta" to call_tool method #621

Open
@jeremyschulman

Description

@jeremyschulman

Is your feature request related to a problem? Please describe.

I would like to be able to pass metadata via the "tools/call" invocation in the call_tool method. This would afford the Caller to use both the pre-defined client_id value anticipated by the Context.client_id attribute, as well as any other Caller specific values.

Describe the solution you'd like

Here is how I have modified my local copy to allow this feature functionality

    async def call_tool(
        self, name: str, arguments: dict[str, Any] | None = None, **meta
    ) -> types.CallToolResult:
        """Send a tools/call request."""
        return await self.send_request(
            types.ClientRequest(
                types.CallToolRequest(
                    method="tools/call",
                    params=types.CallToolRequestParams(name=name, arguments=arguments, _meta=meta)
                )
            ),
            types.CallToolResult,
        )

Could you please consider adding this feature as shown, or an equivalent implementation that would allow for the desired behavior?

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions