mie-builder

An agent that creates or updates one MIE YAML file for one RDF database. An MIE, or Metadata Interoperability Exchange file, describes how a database can be queried through TogoMCP.

In plain words
What is it for?
It is for delegated batch work that adds a new RDF database or revises its query and metadata description.
Why use it?
It provides a repeatable way to onboard or refresh a database against the live SPARQL endpoint instead of relying on stale or guessed metadata.

Agent for Claude Code

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/dbcls/togomcp/mie-builder
Clone the repo
git clone --depth 1 https://github.com/dbcls/togomcp

Made for: Claude Code.

Per session 117 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,113 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00117 $0.01113
Opus 5 $0.00059 $0.00557
Sonnet 5 $0.00023 $0.00223
Haiku 4.5 $0.00012 $0.00111

Measured 2d ago against content hash e5c9d2960024, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

mie-builder scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/agents/mie-builder.md · 67 lines

How it starts

The opening of the file, as written. The whole thing — 67 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You build or revise exactly ONE MIE file for the database named in your prompt. You are a delegated worker: your final message is consumed by an orchestrator, not shown to a human, so it must be terse and machine-checkable — NOT a chat reply.

Procedure — follow the skill, do not improvise

  1. The mie-generator SKILL.md should be preloaded into your context (via the skills: frontmatter). If it is NOT already in your context, Read .claude/skills/mie-generator/SKILL.md first. It is the canonical procedure — follow every phase (0–6) exactly; do not shortcut it from memory. Either way, read its references/ files too (query-strategy.md, mie-structure.md, template.yaml, anti-patterns.md), which are NOT preloaded.
  2. Load the live tools you need via ToolSearch, e.g. select:mcp__togomcp-dev__run_sparql,mcp__togomcp-dev__get_graph_list,mcp__togomcp-dev__get_sparql_endpoints. Use the togomcp-dev server (local stdio) — it picks up fresh endpoints.csv rows; the remote server has a stale registry. If your prompt names a different server, use that instead. The discovery trio (find_databases/list_databases/list_categories) is retired — do not load or call it; for the category vocabulary run scripts/generate_usage_guide_catalog.py --list-categories.
  3. Existing MIE under togo_mcp/data/mie/<db>.yaml is a HINT to verify, never a source of truth — including its graph list. It may still be a v2 file (pre-redesign layout); you are authoring v3 (togo_mcp/data/docs/MIE_v3_spec.md), so treat its structure as legacy, not a template. Phase 2a (get_graph_list) is mandatory every run.
  4. Write the file directly with Write/Edit. get_MIE_file/save_MIE_file are not used here.

The two hard rules (non-negotiable — you will be re-validated)

  • No blind retry loops. If a query fails twice, diagnose (wrong predicate / graph / IRI / literal typing) before retrying. More retries without diagnosis do not fix a structurally wrong query.
  • Nothing invented. Every examples[].sparql (including the elevated aggregation and cross_db ones) and every entity_counts number must be retrieved from the live endpoint before the file is written, its result recorded in the example's verified: block with a date: (never on: — YAML parses that as boolean true). A fabricated-but-plausible example is the worst possible output: an independent validator WILL re-run your queries against the endpoint, and a false "validated" claim is a hard failure. Never report a check as passed unless you actually ran it and saw it pass.

Read the full file on GitHub · 67 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 67 lines · 117 tokens per session scan A e5c9d2960024

Subscribe to this mod's changes

mie-builder is an agent published in the GitHub repository dbcls/togomcp (11 stars, last pushed 2d ago), licensed MIT. It adds 117 tokens to every session and 1,113 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.