Skip to content

The enhance and extract tools always throw a server-side error when called, making them unusable via MCP. #1

Description

@connor11528

Bug

The enhance and extract tools always throw a server-side error when called, making them unusable via MCP.

Error

Error calling tool 'enhance': Invalid variable type: value should be str, int or float, got None of type <class 'NoneType'>
Error calling tool 'extract': Invalid variable type: value should be str, int or float, got None of type <class 'NoneType'>

Root cause

The tool schemas declare several parameters as anyOf: [string, null] (e.g. location, employer, title, school, page_type), meaning null is a valid value per the schema. However the Python server rejects None at runtime with the
above error.

This happens whether the optional fields are passed explicitly as null, passed as empty strings, or omitted entirely — the MCP framework appears to populate unset optional fields as None, which the server then rejects.

Reproduction

Call enhance with any valid Person lookup:

{                                                                                                                                                                                                                                                 
  "type": "Person",       
  "name": ["Connor Leech"],
  "email": ["connor@example.com"],
  "employer": "Acme",                                                                                                                                                                                                                             
  "title": "Engineer",
  "url": [],                                                                                                                                                                                                                                      
  "location": null,                                                                                                                                                                                                                               
  "school": null
}                                                                                                                                                                                                                                                 
                          
Call extract with just a URL:
{
  "url": "https://example.com",
  "format": "markdown"         
}                                                                                                                                                                                                                                                 
 
Both fail. search_web works correctly.                                                                                                                                                                                                            
                                                                                                                                                                                                                                                  
Expected behavior
                                                                                                                                                                                                                                                  
Optional parameters that are null or omitted should be handled gracefully by the server (ignored or treated as unset).                                                                                                                            
 
Environment                                                                                                                                                                                                                                       
                          
- Remote MCP server: https://mcp.diffbot.com/mcp?token=...                                                                                                                                                                                        
- MCP client: Claude Code CLI

Activity

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

Metadata

Metadata

Assignees

No one assigned

    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