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

未關閉
#1 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

評估

難度
3/5
預估耗時
1-2 天
新手友好度
58/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
冷清
技術堆疊
python
領域
api, backend

研究方向

首先定位 enhanceextract 工具的 Python MCP 入口點,並檢查它們的選用 schema 欄位如何傳遞給伺服器。使用此 issue 中的 payload 重現這些呼叫,然後確認 null、空值和省略的選用值不再觸發回報的型別錯誤,同時確保 search_web 不受影響。

由索引模型根據 Issue 內容生成。

描述

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
主要語言
Python
星號
2
分支
1
PR 合併指標
30 天內沒有已合併 PR

貢獻指南

這個儲存庫沒有索引到貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

相似的 Issue

更多 Python Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。