Skip to content

CorpusSource.from_mcp_tools — a tools corpus factory (name + description only, SHA-256 invalidation) #74

Description

@thorwhalen

reelee's MCP connector redesign (thorwhalen/reelee#284, ADR in reelee docs/adr_connector_tool_surface.md §4 Move 4b) records ir as the retrieval substrate of record for tool search over its catalogue, with adoption deferred behind a measured trigger (ir_01 Recommendations Stage 1: Recall@5 < ~0.8 on a held-out set).

When that fires, the clean home for the corpus construction is an ir factory alongside from_skills:

  • CorpusSource.from_mcp_tools(tools) where each tool contributes name + description only — never the parameter schema in the dense text (ir_02 §4 "the body carries no retrieval responsibility"; §8 "Expose arg names to BM25; keep them out of the dense vector").
  • Invalidation key: SHA-256 over (name + description + parameters) per tool (ir_02 §6, ScaleMCP's CRUD pipeline) — parameters participate in the hash (a schema change must re-embed) even though they stay out of the embedded text.
  • Input shape: duck-typed records ({name, description, parameters}) rather than fastmcp types, so ir takes no MCP dependency; a fastmcp adapter can live with the consumer.

Until this exists the consumer-side workaround is CorpusSource.from_mapping({name: name + " " + description}), which loses the schema-aware invalidation. No urgency — reelee will not adopt before its description-hardening pass lands and the Recall@5 measurement is taken.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions