Skip to content

feat(mcp): give agents description, tags, author, relevance and rehostPolicy - #33

Open
MyPrototypeWhat wants to merge 1 commit into
mainfrom
feat/mcp-agent-ref-fields
Open

MyPrototypeWhat wants to merge 1 commit into
mainfrom
feat/mcp-agent-ref-fields

Conversation

@MyPrototypeWhat

Copy link
Copy Markdown
Collaborator

search_references used to give agents only the id, title, license and links. An agent therefore could not judge whether a result really matches, and it had no way to know whether it may store the result's media. rights.rehostPolicy was validated on every record, but nothing ever read it.

Change

  • New fields on each result.
    • description: the source's own caption, capped at 280 characters.
    • tags: the first 8 of the source's subjects.
    • author.
    • relevance: the 0..1 cross-source score after fusion and rerank.
    • rehostPolicy.
  • rehostPolicy gets a reader. The output schema describes each value: hotlink-required means link only, cache-allowed means download and cache, thumbnail-only means keep only the thumbnail, and no-store means keep nothing. The tool description also tells the agent to follow it before downloading or storing anything.
  • sourceScore is left out on purpose. It uses each source's own scale and only orders results within that source, so an agent comparing it across sources would be misled. relevance is the score an agent can compare.
  • Core exports REHOST_POLICIES. Core's own schema now uses it too, so the value list lives in one place, the same pattern as LICENSE_IDS and INTENTS.
  • Docs. The root README, the core README and the MCP README are updated. The changeset is minor for @refkit/core (new export) and @refkit/mcp (new output fields).

Testing

  • Two new MCP tests, both written first and seen failing.
    • The first checks the projected fields: a long description is truncated with an ellipsis, a short one passes unchanged, tags are trimmed to 8, author and rehostPolicy come through, relevance is in 0..1, and sourceScore is absent.
    • The second checks that the tool description and the output schema both explain the four rehostPolicy values.
  • Full gate: pnpm typecheck, pnpm lint, pnpm build, pnpm test:run (521 passed, 23 skipped) and pnpm smoke:artifact.

…tPolicy

search_references projected only id/title/license/links, so an agent could
not judge a match or tell whether it may store a result's media. Add the
source description (capped at 280), the first 8 tags, the author, the
cross-source relevance and rights.rehostPolicy, with each policy value
explained in the output schema and tool description. sourceScore stays out:
it is per-source and not comparable. Core exports REHOST_POLICIES and uses
it in its own schema.
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