Skip to main content
Glama
AiDimag

AI Dimag

Official

memory_pre_edit

Run a guardrail check on a file and code snippet before writing. Get a STOP or PROCEED decision on NEVER-guardrail violations and FAILED_APPROACH warnings to avoid protected area errors.

Instructions

Pre-edit guardrail check for a specific file and code snippet. Given a file path and the code you're about to write, check whether it violates any NEVER guardrails or triggers FAILED_APPROACH warnings. Returns a clear STOP/PROCEED decision. Call this before writing to files in protected areas.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesThe code snippet you're about to write (added lines only)
agent_idNoYour agent identifier, e.g. 'claude-code'
file_pathYesRepo-relative file path being edited
Behavior3/5

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

With no annotations provided, the description carries the whole disclosure burden. It does disclose the key output (a clear STOP/PROCEED decision) and the evaluation basis (NEVER guardrails, FAILED_APPROACH). It remains silent on whether the call is read-only, whether violations mutate state, or any side effects, though the tool reads as a non-destructive check.

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?

Two compact, front-loaded sentences. The opening states the purpose, the next sentences cover input, evaluation criteria, return value, and usage timing. Every sentence earns its place with zero filler.

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?

For a check tool with 3 parameters, no output schema, and no annotations, the definition is nearly complete: it explains purpose, inputs, the returned decision, and when to call. The only residual gap is that NEVER/FAILED_APPROACH semantics are not defined, though these are likely domain concepts shared with the sibling suite.

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

Parameters3/5

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

Schema coverage is 100% and both required parameters (file_path, code) plus agent_id are fully documented in the schema. The description echoes those inputs ('Given a file path and the code you're about to write') without adding syntax or format details, which matches the baseline 3 for high schema coverage.

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?

Opens with the specific verb+resource ('Pre-edit guardrail check') and elaborates what it checks (NEVER guardrails, FAILED_APPROACH warnings) and what it returns (STOP/PROCEED decision). The check is clearly a pre-write validation, distinct in intent from sibling tools like memory_write or memory_check_change, so an agent can tell them apart.

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

Usage Guidelines4/5

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

'Call this before writing to files in protected areas' provides an explicit when-to-use condition. It does not, however, name alternatives or state when not to use it — e.g., that this is only needed for guarded paths and not for ordinary edits — so it stops short of a full 5.

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/AiDimag/aidimag'

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