diaMCP AGENTS.md

diaMCP AGENTS.md is an instructions file for Codex, OpenCode from chartrambiz/diaMCP. It costs 2,200 tokens per session, scanned B, original, MIT.

Instructions for diaMCP, a server that lets coding agents create new tools dynamically. They define the required format and strict rules for writing a tool's Python code.

In plain words
What is it for?
They are for creating agent tools with names, descriptions, input schemas, Python implementations, and any additional packages they need.
Why use it?
They reduce errors when adding tools by requiring imports, a standard function structure, parameters, and optional dependencies in a fixed order.

Instructions file for CodexOpenCode

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 instructions/chartrambiz/diamcp/agents-md
Clone the repo
git clone --depth 1 https://github.com/chartrambiz/diaMCP

Made for: Codex, OpenCode.

Wrote 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.

agentmods badge for diaMCP AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/chartrambiz/diamcp/agents-md.svg)](https://agentmods.dev/instructions/chartrambiz/diamcp/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/chartrambiz/diamcp/agents-md"><img src="https://agentmods.dev/badge/instructions/chartrambiz/diamcp/agents-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 2,200 This file is loaded in full into every session.
When invoked 2,200 The same file — it is already loaded in full.
Security scan B 1 finding. 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.02200 $0.02200
Opus 5 $0.01100 $0.01100
Sonnet 5 $0.00440 $0.00440
Haiku 4.5 $0.00220 $0.00220

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

Security

Grade B, and why

diaMCP AGENTS.md scanned grade B with 1 finding 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 4d 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.

Sends data to an external URLmediumData exfiltration

A POST to an outside endpoint may be telemetry or may be exfiltration; either way the mod talks to somewhere, and you should know where.

response = httpx.post("https://api.example.com/todos", json={"title": title, "completed": completed}, timeout=10)
AGENTS.md · 273 lines

How it starts

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

Agent Tools - diaMCP

This file documents capabilities for AI agents using the diaMCP server.

Creating New Tools

You can create your own tools dynamically using the create_tool function. When you discover an API or need a capability that doesn't exist, you can bootstrap a new tool.

The create_tool Tool

Parameters:

  • name - Tool name (lowercase, underscores, starts with letter)
  • description - What the tool does
  • schema - JSON schema for parameters (as JSON string)
  • code - Python function body (MUST follow the template below)
  • requirements - Optional. Any new Python package dependencies (e.g., yfinance>=1.2.0)

⚠️ STRICT RULES FOR CODE PARAMETER

The code parameter MUST follow this exact template:

# 1. Imports FIRST (before anything else)
import requests
import json

# 2. Then the function with @tool decorator
def my_tool(param1: str, param2: int = 10) -> str:
    """
    Brief description of what this tool does.
    
    Args:
        param1: Description of first parameter
        param2: Description of second parameter (default: 10)
    
    Returns:
        Description of what is returned
    """
    try:
        # Your code here
        return "success"
    except Exception as e:
        return f"Error: {str(e)}"

CRITICAL RULES:

  1. ALL imports MUST be at the very top - before the @tool decorator
  2. The function name MUST match the tool name
  3. The @tool decorator and function definition MUST be together - decorator on line above function
  4. Schema must have proper bracket matching - verify all {} and [] are closed

Example: Creating a Simple Tool

Suppose the user mentions a weather API at api.weather.com with endpoint /current?city=X. You could create a tool:

create_tool(
    name="get_weather",
    description="Get current weather for a city from the weather API",
    schema='''{
        "type": "object",
        "properties": {
            "city": {"type": "string", "description": "City name"}
        },
        "required": ["city"]
    }''',
    code='''import httpx

def get_weather(city: str) -> str:
    """
    Get current weather for a city from the weather API.
    
    Args:
        city: The city name to get weather for
    
    Returns:
        JSON weather data or error message
    """
    try:
        response = httpx.get(f"https://api.weather.com/current?city={city}", timeout=10)
        return response.json()
    except Exception as e:
        return f"Error: {e}"
''',
    requirements="httpx>=0.27.0"
)

Read the full file on GitHub · 273 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. 4d ago First seen · 273 lines · 2,200 tokens per session scan B e8eb3d7125d9

Subscribe to this mod's changes

diaMCP AGENTS.md is an instructions file published in the GitHub repository chartrambiz/diaMCP (20 stars, last pushed 5mo ago), licensed MIT. It adds 2,200 tokens to every session, about $0.0110 per session on Opus 5. A static security scan graded it B with 1 finding (sends data to an external url). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other instructions, from other repositories

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 6,785 tokens

spec-kit AGENTS.md

AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.

github/spec-kit · 7,104 tokens

codex AGENTS.md

AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.

openai/codex · 5,182 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,345 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).

microsoft/vscode · 5,001 tokens

next.js AGENTS.md

Instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,296 tokens