Skip to content

outputSchema is None #1262

@yuhp-zts

Description

@yuhp-zts

Initial Checks

Description

In the tool definition, outputSchema is included, but when calling the tools/list interface, the returned information shows outputSchema=None. What is the reason for this?

  1. The content in the Tool information is:
    {'add_two_numbers': Tool(fn=<function add_two_number at 0x7f95ed506840>, name='add_two_numbers', title=None, description='', parameters={'properties': {'a': {'title': 'A', 'type': 'integer'}, 'b': {'title': 'B', 'type': 'integer'}}, 'required': ['a', 'b'], 'title': 'add_two_numberArguments', 'type': 'object'}, fn_metadata=FuncMetadata(arg_model=<class 'mcp.server.fastmcp.utilities.func_metadata.add_two_numberArguments'>, output_schema={'properties': {'result': {'title': 'Result', 'type': 'integer'}}, 'required': ['result'], 'title': 'add_two_numberOutput', 'type': 'object'}, output_model=<class 'mcp.server.fastmcp.utilities.func_metadata.add_two_numberOutput'>, wrap_output=True), is_async=False, context_kwarg=None, annotations=None)}

  2. The result of calling tools/list is:
    Tool(name='add_two_numbers', title=None, description='', inputSchema={'properties': {'a': {'title': 'A', 'type': 'integer'}, 'b': {'title': 'B', 'type': 'integer'}}, 'required': ['a', 'b'], 'title': 'add_two_numberArguments', 'type': 'object'}, outputSchema=None, annotations=None, meta=None)

Is it because ToolInfo does not include this information?

Example Code

Python & MCP Python SDK

import requests
import asyncio
from mcp import ClientSession
from mcp.client.streamable_http import streamablehttp_client
from mcp.client.sse import sse_client
from mcp.client.stdio import stdio_client
from mcp.server import FastMCP

async def main():
    url = "http://localhost:9200/mcp" 
    async with streamablehttp_client(url=url) as (read, write,id):
        async with ClientSession(read, write) as session:
            await session.initialize()
            tools_list = await session.list_tools()
……

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs confirmationNeeds confirmation that the PR is actually required or needed.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions