Skip to content

[FEATURE] Strands MCP client should support retrieving Output Schema & other Data Types #787

@jkwening

Description

@jkwening

Problem Statement

I would like strands to support MCP output schema tool specs feature: https://modelcontextprotocol.io/specification/2025-06-18/server/tools#data-types

A tool definition includes:
- name: Unique identifier for the tool
- title: Optional human-readable name of the tool for display purposes.
- description: Human-readable description of functionality
- inputSchema: JSON Schema defining expected parameters
- outputSchema: Optional JSON Schema defining expected output structure
- annotations: optional properties describing tool behavior

Proposed Solution

Running the most latest version of python MCP SDK (v1.13.1), I was able to connect and fetch output schema from remote MCP server with the following change to MCPAgentTool tool spec function:

def tool_spec(self) -> ToolSpec:
  """Get the specification of the tool.
  
  This method converts the MCP tool specification to the agent framework's
  ToolSpec format, including the input schema and description.
  
  Returns:
      ToolSpec: The tool specification in the agent framework format
  """
  description: str = self.mcp_tool.description or f"Tool which performs {self.mcp_tool.name}"
  return {
      "inputSchema": {"json": self.mcp_tool.inputSchema},
      "outputSchema": {"json": self.mcp_tool.outputSchema},
      "name": self.mcp_tool.name,
      "description": description,
  }

Use Case

It will allow LLM agents to incorporate enhanced context from MCP servers that have implemented the new MCP data types. I'm working on a use case where an Agent is having issues determine which tool to use and providing the context of the output schema has shown to facilitate discerning the nuances between different tools.

Alternatives Solutions

No response

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions