Skip to main content
Glama
madgodinc

mgi-mind

Official

mind_provenance_add

Persist an externally sourced code or doc snippet with mandatory provenance citation, only when it was just retrieved by a search MCP in the same session.

Instructions

Persist an externally-sourced snippet (code, doc, RFC quote, commit message, etc.) into mgi-mind with a mandatory provenance citation. The agent supplies the snippet AS PLAIN UTF-8: no HTML, no markup. Call this ONLY when the snippet was just produced by a code-search or doc-search MCP in the same session; do NOT fill provenance fields from memory.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileNoOptional path inside the repo. No leading '/', no '..' segments.
langNoOptional language tag (free string).
noteNoOptional one-liner the agent attaches (why this is worth keeping).
repoNoOptional owner/repo when the source is a code host. Regex: ^[\w.-]+/[\w.-]+$.
libraryNoTarget library. Must exist (create with mind_create).external-snippets
snippetYesRaw text to store. Plain UTF-8. Must NOT contain HTML tags; the agent is responsible for stripping markup upstream.
line_rangeNoOptional line range, e.g. "42" or "42-58". Regex: ^\d+(-\d+)?$.
origin_urlYeshttps:// URL the snippet was lifted from. Host must be in the allowlist (github.com, gitlab.com, bitbucket.org, sr.ht, codeberg.org, grep.app, sourcegraph.com).
search_tool_usedYesIdentifier of the search source the agent used in THIS session, e.g. "mcp.grep.app", "sourcegraph", "github code search", "local ripgrep". REQUIRED. Empty rejects with 'provenance source unknown: use mind_add instead'.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden and does disclose key behaviors: the plain-UTF-8/no-markup requirement with the agent responsible for stripping markup upstream, the mandatory-provenance rule, and (via schema) the mind_add fallback. It could go further on persistence semantics (overwrite vs append, idempotency), so not a full 5.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Four front-loaded sentences with essentially zero waste: purpose first, format constraint second, usage rule third. Tight, though the format constraint slightly overlaps with the schema's snippet description.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 9-param write tool with no annotations and no output schema, the description covers the critical constraints (provenance, session-origin, plain text) and the schema covers the rest. Return/persistence semantics are the only modest gap.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so all nine parameters are already documented, including regexes, allowlists, and the failure message on empty search_tool_used. The description adds only the plain-UTF-8 framing already echoed in the snippet field, so baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb (Persist) and resource (externally-sourced snippet) with its distinguishing feature: the mandatory provenance citation. It clearly separates itself from the sibling mind_add by requiring provenance rather than memory-sourced data.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly states when to call (ONLY when the snippet was just produced by a code-search or doc-search MCP in the same session) and when not to (do NOT fill provenance fields from memory). The schema reinforces the routing to mind_add when provenance is unknown, so the agent has an alternative path.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.