Skip to main content
Glama

inject_claude_md

Idempotently update CLAUDE.md with behavioral rules between markers, preserving existing content. Creates file if missing; safe for frequent execution.

Instructions

Idempotently write rule-level patterns into a CLAUDE.md file.

    Updates only the block between <!-- instinct:start --> and
    <!-- instinct:end --> markers; everything else in the file is
    preserved. Creates the file (and markers) if they do not exist.
    Safe to run on every commit or session end without producing churn.

    For one-shot rendering without touching the filesystem, use
    export_claude_md() and write the output yourself.

    Args:
        target: Absolute or relative path to the CLAUDE.md file. Parent
            directories must exist; the file itself will be created.

    Returns:
        Dict with keys: "target" (str — echoed path), "rule_count"
        (int), "changed" (bool — false when content matched existing
        block, true when the file was actually rewritten).
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
targetYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description bears full responsibility. It discloses idempotent writes, marker-based partial updates, file creation if missing, and the return dict. It notes the prerequisite that parent directories must exist, but does not cover all potential side effects (e.g., permission issues) – a minor gap.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with a leading one-sentence summary, followed by detailed behavior, an alternative tool mention, and structured Args/Returns sections. Every sentence provides essential information without redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (one parameter, no nested objects, output schema indicated), the description covers purpose, usage, behavioral constraints, and return values thoroughly. However, it omits explicit error cases (e.g., missing parent directories would cause failure) and does not define 'rule-level patterns', assuming domain knowledge. Minor completeness gaps exist.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The sole parameter 'target' has 0% schema description coverage, so the description must compensate. It does so thoroughly: explains it is an absolute or relative path, that the file itself will be created, and that parent directories must exist. This adds significant meaning beyond the schema type.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description explicitly states 'Idempotently write rule-level patterns into a CLAUDE.md file' with a clear verb and resource. It distinguishes itself from the sibling tool export_claude_md by noting it modifies files versus one-shot rendering without filesystem impact.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context: it is safe to run on every commit or session end, and it suggests using export_claude_md for one-shot rendering. It also explains idempotency and the marker-based block update, offering explicit usage guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/WRG-11/instinct'

If you have feedback or need assistance with the MCP directory API, please join our Discord server