Skip to content

Conversation

@shalarn1
Copy link
Collaborator

@shalarn1 shalarn1 commented Sep 23, 2025

The customizer was removing schema definitions ($defs) from MCP tool input schemas, leaving schema references dangling and causing "PointerToNowhere" errors when schema references couldn't resolve for tools with complex schemas (ie nested references).

ex:

prev

  🔧 pointInTimeMetrics: 
    name='pointInTimeMetrics'
    title=None description=None
    inputSchema={
        'type': 'object', 
        'properties': {
            'metrics': {'type': 'array', 'items': {'$ref': '#/$defs/MetricAggregation'}}, // unresolved schema reference -> PointerToNowhere error
            'timeAttribute': {'type': 'string'}
            },
        'required': [ 'metrics']
    }
    outputSchema=None annotations=None meta={'_fastmcp': {'tags': ['cortex-api', 'openapi', 'public-eng-intel-metrics-controller']}}

now

  🔧 pointInTimeMetrics:
    name='pointInTimeMetrics'
    title=None description=None
    inputSchema={
        'type': 'object',
        'properties': {
            'metrics': {'type': 'array', 'items': {'$ref': '#/$defs/MetricAggregation'}},
            'timeAttribute': {'type': 'string'}},
        'required': ['metrics'],
        // preserve $defs schema definitions
        '$defs': {
            'MetricAggregation': {'required': ['aggregation', 'metric'], 'type': 'object', 'properties': {'aggregation': {'enum': ['SUM', 'AVG', 'COUNT', 'RATIO', 'MIN', 'MAX', 'P50', 'P95', 'RANKING'], 'type': 'string'}, 'metric': {'type': 'string'}}}
        }
    }
    outputSchema=None annotations=None meta={'_fastmcp': {'tags': ['cortex-api', 'openapi', 'public-eng-intel-metrics-controller']}}

The customizer was removing $defs from MCP tool parameter schemas, leaving
schema references dangling and causing "PointerToNowhere" errors for
tools with complex nested schemas.
@shalarn1 shalarn1 requested a review from maddymanu September 23, 2025 19:18
@shalarn1
Copy link
Collaborator Author

shalarn1 commented Sep 24, 2025

This solved the original missing refs issues but $defs contained more nested $ref references (e.g., $ref -> $defs -> $ref chains) and FastMCP could not resolve these complex reference chains. We need to use a dereferencing script to replace ALL $ref with inline schema definitions, and eliminate the need for $defs entirely. See upstream issue: jlowin/fastmcp#1372

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants