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
| Name | Required | Description | Default |
|---|---|---|---|
| file | No | Optional path inside the repo. No leading '/', no '..' segments. | |
| lang | No | Optional language tag (free string). | |
| note | No | Optional one-liner the agent attaches (why this is worth keeping). | |
| repo | No | Optional owner/repo when the source is a code host. Regex: ^[\w.-]+/[\w.-]+$. | |
| library | No | Target library. Must exist (create with mind_create). | external-snippets |
| snippet | Yes | Raw text to store. Plain UTF-8. Must NOT contain HTML tags; the agent is responsible for stripping markup upstream. | |
| line_range | No | Optional line range, e.g. "42" or "42-58". Regex: ^\d+(-\d+)?$. | |
| origin_url | Yes | https:// 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_used | Yes | Identifier 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'. |