feat(mcp): trim wide-table payload in get_entity_details#28776
feat(mcp): trim wide-table payload in get_entity_details#28776Vishnuujain wants to merge 3 commits into
Conversation
…riptions, schema/model sql)
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
| { | ||
| "name": "get_entity_details", | ||
| "description": "Get detailed information about a specific entity by its fully qualified name, including its custom properties (returned under the 'extension' field). IMPORTANT: Use the 'fullyQualifiedName' and 'entityType' values directly from search_metadata or semantic_search results — do not construct the FQN manually. Response is optimized for LLM context by excluding verbose metadata fields.", | ||
| "description": "Get detailed information about a specific entity by its fully qualified name, including its custom properties (returned under the 'extension' field). IMPORTANT: Use the 'fullyQualifiedName' and 'entityType' values directly from search_metadata or semantic_search results — do not construct the FQN manually. Response is optimized for LLM context: verbose metadata fields are excluded, and per-column descriptions and raw schema/model SQL are truncated at 500 characters (marked with 'columnDescriptionsTruncated' / 'schemaDefinitionTruncated' when cut). The entity-level description is always returned in full.", |
There was a problem hiding this comment.
💡 Quality: tools.json omits dataModel 'sqlTruncated' flag from description
The updated get_entity_details description advertises that truncation is signalled via columnDescriptionsTruncated and schemaDefinitionTruncated, but the code also truncates dataModel.sql/dataModel.rawSql and emits a sqlTruncated flag nested inside dataModel. Since the tool description is what the LLM reads to interpret the response, it won't know that dbt/data-model SQL may be cut or that a sqlTruncated marker exists. Consider mentioning the dataModel.sqlTruncated flag in the tool description so the consuming model can reason about truncated model SQL the same way it does for schema DDL.
Mention the dataModel SQL truncation flag in the tool description.:
...truncated at 500 characters (marked with 'columnDescriptionsTruncated' / 'schemaDefinitionTruncated', or 'sqlTruncated' inside 'dataModel', when cut). The entity-level description is always returned in full.
- Apply fix
Check the box to apply the fix or reply for a change | Was this helpful? React with 👍 / 👎
Code Review 👍 Approved with suggestions 0 resolved / 1 findingsImplements recursive payload truncation for wide tables in 💡 Quality: tools.json omits dataModel 'sqlTruncated' flag from description📄 openmetadata-mcp/src/main/resources/json/data/mcp/tools.json:185 📄 openmetadata-mcp/src/main/java/org/openmetadata/mcp/tools/GetEntityTool.java:141-150 The updated Mention the dataModel SQL truncation flag in the tool description.🤖 Prompt for agentsOptionsDisplay: compact → Showing less information. Comment with these commands to change:
Was this helpful? React with 👍 / 👎 | Gitar |
🔴 Playwright Results — 3 failure(s), 12 flaky✅ 4263 passed · ❌ 3 failed · 🟡 12 flaky · ⏭️ 88 skipped
Genuine Failures (failed on all attempts)❌
|
Stacked on #28764 (uses its
McpResponseTrimutil) — merge that first; this auto-retargets to main.What
children) — the N× multiplier on wide tables. A single top-levelcolumnDescriptionsTruncated:truemarks when anything was cut.schemaDefinitionanddataModel.sql/rawSqltruncation at 500 chars with flags (same pattern as lineage SQL).incrementalChangeDescriptionleak — audit blob was missing from the exclude list (live-verified in real responses).safeMessage).Notes
extension(custom properties, fix(mcp): surface custom properties (extension) in get_entity_details #28594) preserved at table and column level;columns/tags/customMetricsuntouched.