Skip to main content
Glama

edit_hitl

Edit files by replacing text fragments only after mandatory human approval, using a two-step session-token flow to confirm changes.

Instructions

Edita un archivo existente reemplazando un fragmento de texto. REQUIERE aprobación humana.

Flujo correcto (dos llamadas):

  1. Llama con approved: false → recibirás instrucciones y un sessionToken

  2. Usa question() para mostrar el cambio al usuario y pedir aprobación

  3. Llama de nuevo con approved: true + el sessionToken recibido

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
approvedYestrue solo si el usuario aprobó via question()
filePathYesRuta del archivo (relativa al PROJECT_ROOT o absoluta)
newStringYesTexto de reemplazo
oldStringYesTexto exacto a reemplazar
replaceAllNoSi true, reemplaza TODAS las ocurrencias. Default: false (solo la primera)
sessionTokenNoToken recibido en el bloqueo previo o de declare_intent_hitl
Behavior4/5

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

With no annotations provided, the description carries the safety burden. It discloses the human-approval requirement and the two-phase behavior, including that the first call returns instructions and a sessionToken and the second call performs the edit only after approval. It does not detail error cases or the response of the approved call, but the core behavioral trait is transparent.

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 compact and front-loaded: one purpose sentence, one requirement line, and a numbered flow. Every sentence earns its place, and the numbered steps make the required sequence easy to follow.

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 multi-step HITL tool with no output schema and no annotations, the description covers the essential call sequence, the role of the token, and the need for question(). Minor gaps exist around what the second call returns and what happens on failure, but an agent can invoke the tool correctly from this definition.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3. The description adds protocol-level meaning to 'approved' and 'sessionToken' by explaining how they relate across the two required calls, which goes beyond the individual schema field descriptions.

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 opens with a specific verb+resource sentence ('Edita un archivo existente reemplazando un fragmento de texto') that clearly identifies the operation and scope. The word 'existente' and the HITL approval requirement distinguish it from siblings like write_hitl and bash_hitl.

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?

It provides a clear two-call protocol: call with approved:false, ask the user via question(), then call with approved:true and the sessionToken. This is strong when-to-use guidance for the HITL flow, though it does not explicitly state when not to use the tool or name alternative tools for other file operations.

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/Santi746/IA-HITL-PROTOCOL'

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