Getting it into your agent
It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.
git clone --depth 1 https://github.com/kouroshez/coding-osnpx agentmods add skills/kouroshez/coding-os/mcp-tool-authoringWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/kouroshez/coding-os/mcp-tool-authoring)<a href="https://agentmods.dev/skills/kouroshez/coding-os/mcp-tool-authoring"><img src="https://agentmods.dev/badge/skills/kouroshez/coding-os/mcp-tool-authoring/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/kouroshez/coding-os/mcp-tool-authoring"><img src="https://agentmods.dev/badge/skills/kouroshez/coding-os/mcp-tool-authoring.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00145 | $0.03163 |
| Opus 5 | $0.00072 | $0.01581 |
| Sonnet 5 | $0.00029 | $0.00633 |
| Haiku 4.5 | $0.00015 | $0.00316 |
Grade A, and why
mcp-tool-authoring 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 5d 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.
How it starts
The opening of the file, as written. The whole thing — 302 lines — stays where its author put it; the contents beside it link to each section on GitHub.
mcp-tool-authoring
Purpose: Make every new cos_* MCP tool match the contract every other tool follows. Drift here breaks the agent (deferred-tool schema lookups), the envelope (Rule 13), or the migration (Rule 9). One canonical authoring path keeps the ~80 tools coherent.
Read when: editing files matching:
src/core/thinking_os/tools/*.py— MCP tools registered with the FastMCP server.src/core/graph_os/tools/*.py— graph-side tools (cos_graph_*).src/core/board_os/mcp_tools.py— Scrumban / task tools.src/core/web/routes/*.py— HTTP routes that wrap an MCP tool for the Hub UI.src/core/thinking_os/server.py— when registering a new tool module.
Skip when: editing tests, helpers, or non-tool internals.
The Five Hard Contracts
Every cos_* tool MUST satisfy ALL of:
1. Name prefix cos_ (Rule 2)
@mcp.tool
@safe_tool
async def cos_search(query: str, limit: int = 5) -> dict:
...
Names without the cos_ prefix are silently rejected from the tool inventory. The inventory is the SSOT for docs/governance/mcp-tool-inventory.md (regenerated, not hand-edited).
2. Envelope shape via @safe_tool (Rule 13)
Every tool returns ok(data) or fail(category, message). The decorator does this for you:
from core.thinking_os.tools._shared import safe_tool, ok, fail
@mcp.tool
@safe_tool # converts raw exceptions to fail() envelopes
async def cos_search(query: str, limit: int = 5) -> dict:
if not query:
return fail("invalid_input", "query is required")
rows = await _db.search(query, limit=limit)
return ok({"results": rows, "count": len(rows), "meta": {"layer": "memory"}})
fail categories are documented in docs/engineering/mcp-error-envelope.md: invalid_input, not_found, unavailable, permission_denied, internal_error, rate_limited. Don't invent new categories without updating the contract doc.
3. ONE-line docstring (Rule 12)
What ships with it
2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
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.
- 5d ago First seen · 302 lines · 145 tokens per session scan A c73d26a7b23f
mcp-tool-authoring is a skill published in the GitHub repository kouroshez/coding-os (6 stars, last pushed yesterday), licensed Apache-2.0. It adds 145 tokens to every session and 3,163 once invoked, about $0.0007 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-09-03.
Other skills, from other repositories
potpie-graph
Use when the task can read or write the project-memory graph through the potpie CLI: discover the contract with graph catalog, read named views with graph read, resolve entity identity with graph search-entities, create validated plans with graph propose, commit plans with graph commit --verify, inspect quality with…
potpie-source-ingestion
Use when the user explicitly asks to ingest, refresh, or deeply understand a repository, PR, issue, ticket, runbook, incident report, document, or web link into Potpie. The harness performs todo-driven discovery, uses local/GitHub/integration tools and read-only subagents when available, builds evidence-backed…
potpie-repo-baseline
Use when establishing, refreshing, or deeply understanding a repository's baseline memory in Potpie: purpose, application type, features, services/modules, environments, deploy shape, dependencies, API contracts, datastores, integrations, ownership, and explicit preferences. The harness reads authored and…
graph-mutation-plan
Cookbook for composing an applygraphmutations plan — stable entitykey patterns, the canonical label/edge vocabulary, evidence/invalidation/confidence discipline, and a worked example. Load this when building a non-trivial mutation plan.
potpie-cli
Use when the task is centered on running, explaining, configuring, or troubleshooting the potpie command: doctor, login, pot management, source registration, search, graph workbench reads/writes, and pot scope behavior.
potpie-change-timeline
Use when an agent needs recent or historical change context: what changed recently, regressions, merged PRs, tickets, docs, incidents, deployments, releases, and source-history ingestion.