Skip to content

[BUG] Tool output schema is not passed to LLM #1956

@rommar

Description

@rommar

Issue

I'm trying to create an MCP sever. So far, it is at the level of "hello world" app. I want to use MCPJam to debug interaction between MCP server, MCP client and LLM. My MCP server exposes a tool to get weather by city name. I see that the server correctly responds to tools list request from MCPJam. However, when I send request to LLM like "Tell me weather in Paris" I see that only input schema is passed to the LLM, but not output schema. I suspect that this causes the LLM to ignore one parameter ('x') in response from my MCP server.

How to reproduce

  1. Create MCP server. Code (python):
from mcp.server.fastmcp import FastMCP
from pydantic import BaseModel, Field

mcp = FastMCP("My App")

class WeatherData(BaseModel):
    """Weather information structure."""
    temperature: float = Field(description="Temperature in Celsius")
    humidity: float = Field(description="Humidity percentage")
    condition: str
    wind_speed: float
    x: int = Field(description='Density of seagulls in the sky')

@mcp.tool()
def get_weather(city: str) -> WeatherData:
    """Get weather for a city - returns structured data."""
    # Simulated weather data
    return WeatherData(
        temperature=22.5,
        humidity=45.0,
        condition="sunny",
        wind_speed=5.2,
        x=21
    )

# Run with streamable HTTP transport
if __name__ == "__main__":
    mcp.run(transport="streamable-http")

  1. Start with python mpc_server.py

  2. Attach this MCP server to MCPJam.

  3. In MCPJam Chat mode write "Tell me weather in Paris".

  4. Look into "raw" tab. Output schema is not passed to LLM even though the MCP sever exposes it.

  5. The LLM cannot interpret additional parameter "x". I get this response:

Here's the current weather in Paris:
Temperature: 22.5°C (about 72.5°F)
Condition: Sunny ☀️
Humidity: 45%
Wind Speed: 5.2 km/h (light breeze)
It's a beautiful day in Paris with pleasant sunny weather and mild temperatures!

Full raw output:

{
  "system": "You are a helpful assistant with access to MCP tools.",
  "tools": {
    "get_weather": {
      "name": "get_weather",
      "description": "Get weather for a city - returns structured data.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "city": {
            "title": "City",
            "type": "string"
          }
        },
        "required": [
          "city"
        ],
        "title": "get_weatherArguments",
        "additionalProperties": false
      }
    }
  },
  "messages": [
    {
      "role": "user",
      "content": "Tell me weather in Paris"
    },
    {
      "role": "assistant",
      "content": [
        {
          "type": "tool-call",
          "toolCallId": "toolu_bdrk_017HpA6Jp2hYT3K5Ef1b4Ugy",
          "toolName": "get_weather",
          "input": {
            "city": "Paris"
          }
        }
      ]
    },
    {
      "role": "tool",
      "content": [
        {
          "type": "tool-result",
          "toolCallId": "toolu_bdrk_017HpA6Jp2hYT3K5Ef1b4Ugy",
          "toolName": "get_weather",
          "output": {
            "type": "json",
            "value": {
              "content": [
                {
                  "type": "text",
                  "text": "{\n  \"temperature\": 22.5,\n  \"humidity\": 45.0,\n  \"condition\": \"sunny\",\n  \"wind_speed\": 5.2,\n  \"x\": 21\n}"
                }
              ],
              "structuredContent": {
                "temperature": 22.5,
                "humidity": 45,
                "condition": "sunny",
                "wind_speed": 5.2,
                "x": 21
              },
              "isError": false
            }
          },
          "result": {
            "content": [
              {
                "type": "text",
                "text": "{\n  \"temperature\": 22.5,\n  \"humidity\": 45.0,\n  \"condition\": \"sunny\",\n  \"wind_speed\": 5.2,\n  \"x\": 21\n}"
              }
            ],
            "structuredContent": {
              "temperature": 22.5,
              "humidity": 45,
              "condition": "sunny",
              "wind_speed": 5.2,
              "x": 21
            },
            "isError": false
          },
          "serverId": "my-mpc"
        }
      ]
    }
  ]
}

Expected Behavior

I expect that MCPJam, acting as MCP client should pass tool output schema to the LLM, so that LLM can interpret all parameters in the tool call output from MCP server. So that I would get a response like:

Here's the current weather in Paris:
.....
Density of seagulls in the sky is 21.

Screenshots

Image

Platform

Windows 11.
MCJam was started with npx @mcpjam/inspector@latest.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions