Repository navigation
feat(mcp): shared limits, truncation, list coercion and ToolError mapping - #21342
Conversation
PR SummaryOverview Configurable response sizing — LLM-friendly tool parameters — New Unified GraphQL failures — Deps/tests — Adds pydantic to Reviewed by Cursor Bugbot for commit 13529b9. Bugbot is set up for automated code reviews on this repo. Configure here. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 66ac9c1. Configure here.
|
lgtm. tiny nit: |
66ac9c1 to
9ada623
Compare
4f50cf0 to
87d71cc
Compare
…ping
Add the data helpers the tool ports build on.
- Size limits for tool output, overridable with the same environment
variables as mcp-server-datahub (DESCRIPTION_LENGTH_LIMIT,
QUERY_LENGTH_LIMIT, DOCUMENT_CONTENT_CHAR_LIMIT,
FIELD_DESCRIPTION_LENGTH_LIMIT, ...). A non-numeric or non-positive value
fails at startup with the variable's name.
- truncate_with_ellipsis, including limits shorter than the suffix and a
"[+N chars]" marker.
- arg_validation: StrList and friends accept a list that a client sent as
a JSON string or a bare value, while the published schema stays a single
array type ("" and "null" count as omitted). coerce_keyword_list also
splits comma-joined keywords.
- execute_graphql raises ToolError with a message the model can act on
(rejected token, GMS unreachable, GraphQL errors); format_exception=False
keeps the SDK's raw GraphError for callers that act on error types.
datahub-ai-service's token check reuses its HTTP status helper.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CI's package check compares find_packages with find_namespace_packages, and the gql directory had no __init__.py. Make it a package and declare its .gql files as its own package data. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Installing metadata-ingestion and the two packages from source resolves their build requirements from the configured index. In CI that index needs the netrc secret, which only the lock install step mounted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
FastMCP 4.2.5 serves subscriptions/listen, and on the 2026-07-28 protocol the SDK advertises listChanged whenever that handler is registered, overriding the notification options. Drop the handler: the server never sends change notifications, and an in-process bus can't reach clients on another replica. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
master now adds its own placeholder right after __SYSTEM_CLIENT_SECRET__. Keeping ours one line further down lets both changes merge without a conflict. The replacements are independent, so their order doesn't matter. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Stack. This is one PR in a series that adds a built-in MCP server to DataHub Core. It is based on
na--mcp-execution-helpers(the previous PR in the stack); review only its own commit. It changes only the shareddatahub-core-mcp-toolspackage anddatahub-ai-service. Everything user-facing is behind a GMS feature flag,MCP_SERVER_ENABLED, off by default (added in #21349).Stack so far:
What this does
Add the data helpers the tool ports build on.
variables as mcp-server-datahub (DESCRIPTION_LENGTH_LIMIT,
QUERY_LENGTH_LIMIT, DOCUMENT_CONTENT_CHAR_LIMIT,
FIELD_DESCRIPTION_LENGTH_LIMIT, ...). A non-numeric or non-positive value
fails at startup with the variable's name.
"[+N chars]" marker.
a JSON string or a bare value, while the published schema stays a single
array type ("" and "null" count as omitted). coerce_keyword_list also
splits comma-joined keywords.
(rejected token, GMS unreachable, GraphQL errors); format_exception=False
keeps the SDK's raw GraphError for callers that act on error types.
datahub-ai-service's token check reuses its HTTP status helper.
Testing
Unit tests incl. published schema shape.
Checklist
🤖 Generated with Claude Code