Fixes 30158: Improve AI context rendering for MCP consumers#30159
Fixes 30158: Improve AI context rendering for MCP consumers#30159harshach wants to merge 5 commits into
Conversation
❌ 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 |
✅ TypeScript Types Auto-UpdatedThe generated TypeScript types have been automatically updated based on JSON schema changes in this PR. |
Code Review ✅ Approved 3 resolved / 3 findingsImproves AI context rendering for MCP consumers by adding bounded column-level lineage and replacing REST pointers with tool-call references. Resolved issues related to redundant truncation notices and Markdown corruption. ✅ 3 resolved✅ Edge Case: Cap note shown even when column mappings not truncated
✅ Edge Case: Cap note emitted for edges with exactly 25 mappings
✅ Quality: Backticks in function/FQN values can corrupt inline Markdown
OptionsDisplay: compact → Showing less information. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Gitar |
✅ TypeScript Types Auto-UpdatedThe generated TypeScript types have been automatically updated based on JSON schema changes in this PR. |
Code Review ✅ Approved 3 resolved / 3 findingsImproves AI context rendering for MCP consumers by adding bounded column-level lineage and replacing REST pointers with tool-call references. Resolved issues related to redundant truncation notices and Markdown corruption. ✅ 3 resolved✅ Edge Case: Cap note shown even when column mappings not truncated
✅ Edge Case: Cap note emitted for edges with exactly 25 mappings
✅ Quality: Backticks in function/FQN values can corrupt inline Markdown
OptionsDisplay: compact → Showing less information. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Gitar |
|
|
🔴 Playwright Results — 2 failure(s), 27 flaky✅ 4540 passed · ❌ 2 failed · 🟡 27 flaky · ⏭️ 96 skipped
Genuine Failures (failed on all attempts)❌
|



Describe your changes:
Fixes #30158
This fixes AI context consumption for MCP clients by distinguishing absent schema constraints, preserving bounded column-level lineage, and replacing REST follow-up pointers with registered MCP tool calls.
Type of change:
High-level design:
upstreamEdgesanddownstreamEdgescontexts while retaining the existing FQN arrays--for absent constraintsget_asset_context(...)pointersTests:
Use cases covered
NULL, andPRIMARY_KEYconstraint renderingUnit tests
AIContextBuilderTest,AIContextMarkdownTest,PersonaContextBuilderTest,PersonaContextMarkdownTestBackend integration tests
openmetadata-integration-tests/AIContextRestIT,AIContextMcpIT, andPersonaAIContextITwere not run locallyIngestion integration tests
Playwright (UI) tests
Manual testing performed
No manual testing was performed beyond the automated checks above.
UI screen recording / screenshots:
Not applicable — no UI behavior changes.
Checklist:
Fixes <issue-number>: <short explanation>Fixes #<issue-number>aboveGreptile Summary
This PR improves AI context output for MCP consumers. The main changes are:
Confidence Score: 5/5
The latest changes look safe to merge.
Important Files Changed
Comments Outside Diff (1)
openmetadata-service/src/main/java/org/openmetadata/service/aicontext/AIContextMarkdown.java, line 580-589 (link)An edge with exactly 25 mappings satisfies this condition even though
edgeColumns()only truncates lists larger than 25. The Markdown therefore tells consumers to fetch omitted lineage when the complete mapping list was already rendered.Reviews (5): Last reviewed commit: "Merge branch 'main' into harshach/ai-con..." | Re-trigger Greptile
Context used (3)