diaMCP: Instructions file for Codex

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

Written for Codex and OpenCode: the file is AGENTS.md.

This is chartrambiz/diaMCP's own configuration. It tells Codex and OpenCode how to work on diaMCP itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything diaMCP configures →

Reuse

Borrowing it

Nothing to install: this file belongs to chartrambiz/diaMCP. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/chartrambiz/diaMCP/master/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/github.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/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.

agentmods 80×15 button for diaMCP AGENTS.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/chartrambiz/diamcp/agents-md"><img src="https://agentmods.dev/badge/instructions/chartrambiz/diamcp/agents-md.svg" alt="Reviewed on agentmods" width="80" 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. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.02200 $0.02200
Opus 5.5 $0.00880 $0.00880
Sonnet 5.5 $0.00440 $0.00440
Haiku 4.5 $0.00220 $0.00220

Measured 2mo ago against content hash e8eb3d7125d9, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 2mo 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. 2mo 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 7mo ago), licensed MIT. It adds 2,200 tokens to every session, about $0.0088 per session on Opus 5.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

diaMCP AGENTS.md compared with instructions from other repositories

diaMCP AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
diaMCP AGENTS.mdchartrambiz/diaMCPInstructions file207mo agoMITB2,200Codex, OpenCode
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143kyesterdayMITA7,461Codex, OpenCode
langchain AGENTS.mdlangchain-ai/langchainInstructions file149kyesterdayMITA4,680Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA5,516GitHub Copilot
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file274k2d agoMITA4,313Codex, OpenCode