Skip to content

[MCP] company outputSchema declares employees as integer, but API returns string #1184

Description

@aaajiao

Problem

The company MCP tool advertises an outputSchema where employees is an integer, but the underlying Longbridge API represents employees as a JSON string. MCP clients that validate structuredContent against the advertised schema reject the otherwise successful result.

This was observed with the Hosted MCP company tool. Other tested read-only tools work normally, so this is not an OAuth scope or MCP tool-filter issue.

Evidence

Expected

The company structured result validates against its advertised MCP outputSchema.

Actual

When the response includes an employees string, validation fails because the output schema requires an integer.

Suggested fix

Change CompanyResponse.employees from Option<i64> to Option<String> so it matches the canonical API contract, and add a regression test that validates the returned structuredContent against the declared outputSchema.

Converting the API value to an integer would be less robust because the canonical contract intentionally exposes this field as a string.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

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