Skip to content

Progressive disclosure of tools and dynamic DB-defined objects#282

Merged
remi-td merged 14 commits intomainfrom
db-tool-registry
Mar 24, 2026
Merged

Progressive disclosure of tools and dynamic DB-defined objects#282
remi-td merged 14 commits intomainfrom
db-tool-registry

Conversation

@remi-td
Copy link
Copy Markdown
Collaborator

@remi-td remi-td commented Mar 24, 2026

Summary

  • Progressive disclosure: Tools are now registered incrementally based on context, reducing noise for LLM clients. Enabled via --progressive_disclosure CLI flag.
  • Database-defined tool registry: Tools, prompts, and resources can now be defined dynamically in the database (volatile tables), allowing runtime customization without server restarts.
  • Context catalog: New ContextCatalog layer routes tool discovery through categories (base, dba, bar, etc.) enabling staged exposure.
  • Registry middleware hook: on_initialize in RequestContextMiddleware triggers registry refresh on each new client session.
  • Volatile table persistence: base_readQuery gains a persist parameter to materialize large result sets as volatile tables for reuse.

Key new files

  • src/teradata_mcp_server/tools/context_catalog.py — tool catalog with progressive disclosure logic
  • src/teradata_mcp_server/tools/registry/ — DB-backed tool registry loader and tools
  • src/teradata_mcp_server/tools/utils/factory.py — unified async MCP tool factory
  • examples/server-customisation/registry_setup.sql — SQL to set up the registry schema
  • docs/developer_guide/PROGRESSIVE_DISCLOSURE.md / REGISTRY_IMPLEMENTATION.md

Test plan

  • Start server with --progressive_disclosure flag and verify tools are exposed incrementally
  • Start server without the flag and verify all tools load statically (existing behavior)
  • Load registry tools from DB and verify they appear after session init
  • Run base_readQuery with persist=True and verify volatile table is created and sampled
  • Run existing CI tests to confirm no regressions

🤖 Generated with Claude Code

remi-td and others added 14 commits December 16, 2025 18:32
Resolves conflicts preserving both feature sets:
- Progressive disclosure of tools (this branch)
- Dynamic DB-defined objects via registry (this branch)
- SHOW command DDL extraction (main)
- Ruff formatting / snake_case renames (main)
- CI workflow, CLAUDE.md, auth improvements (main)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Fix curly quotes (U+201C/U+201D) in base_tools.py introduced during merge
- Fix search_tool to return standard {"status":"success","results":...} JSON
  envelope so the test runner can parse it correctly
- Add base_readQuery persist=True test case to core_test_cases.json
- Add progressive_disclosure_test_cases.json covering search_tool (list,
  exact match, keyword search) and execute_tool (readQuery, tableList,
  databaseList)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Fix UP035: replace deprecated typing.Dict/List/Set/Tuple/Optional imports with built-in types
- Fix SIM105: use contextlib.suppress instead of try-except-pass
- Fix SIM108: convert if-else blocks to ternary operators
- Fix SIM118: remove redundant .keys() in dict iteration
- Fix SIM222: simplify 'param_defs or True' to 'True'
- Fix B007: rename unused loop variables to _i, _tool_name
- Fix E721: use 'is' instead of '==' for type comparisons
- Fix mypy: correct on_initialize return type signature
- Fix mypy: add Optional annotation for arguments parameter
- Fix mypy: add type annotation for params_by_tool dict
- Fix mypy: handle None safety for sql.rstrip()
- Add PLR2004 to ruff ignore (magic values in row index access patterns)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@remi-td remi-td merged commit bdd253b into main Mar 24, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant