Skip to content

Conversation

@justincasher
Copy link
Owner

Summary

  • Improved server-level instructions and all tool docstrings to clearly communicate that search supports both name-based queries (e.g., List.map, Nat.Prime) and semantic/natural language queries (e.g., "continuous function on a compact set")
  • Replaced the monolithic get_by_id tool with 6 focused per-field tools to reduce context pollution for AI agents:
    • get_source_code — Lean source code
    • get_source_link — GitHub link to source
    • get_docstring — documentation string
    • get_description — natural language informalization
    • get_module — module path in the package
    • get_dependencies — declarations this depends on
  • Each tool returns only {id, name, <field>}, so agents fetch exactly what they need
  • Added recommended workflow guidance in server instructions: search_summary → per-field tools → search only when all fields needed

Test plan

  • All 46 MCP tool tests pass (30 new tests for 6 new tools)
  • Full test suite passes (186 tests)
  • Ruff lint clean
  • Verify AI agents use the new tools correctly in practice

- Improve server-level instructions and all tool docstrings to clearly
  communicate hybrid search (by name and by meaning) with examples
- Replace monolithic get_by_id tool with 6 focused per-field tools:
  get_source_code, get_source_link, get_docstring, get_description,
  get_module, get_dependencies
- Each tool returns only id, name, and the requested field to reduce
  context pollution for AI agents
- Add shared _execute_backend_get_by_id helper
- Update search and search_summary docstrings to reference new tools
- Replace TestGetByIdTool tests with 6 new test classes (30 tests)
@justincasher justincasher merged commit 72649d9 into main Jan 31, 2026
2 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.

2 participants