Skip to main content
Glama

trw_before_edit_hint

Provides codebase intelligence before editing a file, returning risk context and prior learnings to inform safe edits.

Instructions

Return cold-start codebase intelligence for file_path.

Use when an agent is about to edit a file and needs sidecar-backed risk context plus relevant prior learnings before reading broadly.

Sources:

  • trw-distill sidecar (tier-gated; requires team/pro/enterprise)

  • existing learnings via trw_recall (always)

Returns BeforeEditHintResult.model_dump() enriched by client tier. NEVER raises — failure paths populate distill_status + distill_action so the operator gets an actionable next step.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cache_dirNo
file_pathYes
repo_rootNo

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 carries full burden. It discloses it never raises, details failure paths (distill_status/action), mentions sources (sidecar, recalls), and tier-gating. It does not explicitly state side effects but implies read-only.

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

Conciseness4/5

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

Description is concise (6 lines) with clear sections: purpose, usage, sources, error behavior. Front-loaded, no fluff, but could be slightly more structured.

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

Completeness3/5

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

Output schema exists, reducing need for return value detail. Description covers purpose, usage, error handling, and sources. Missing: optional parameter descriptions and operational details like rate limits or permissions.

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

Parameters2/5

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

Schema has 0% description coverage. Description explains the main parameter file_path but ignores cache_dir and repo_root, leaving those semantically unenriched.

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

Purpose4/5

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

Description clearly states the tool returns cold-start codebase intelligence for a file_path, with an explicit use case (before editing). However, it does not explicitly differentiate from its sibling trw_before_edit_hint_batch, though the name implies singular vs batch.

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

Usage Guidelines3/5

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

Description explains when to use (before editing a file needing risk context and prior learnings) but does not provide exclusions or compare with alternatives like trw_before_edit_hint_batch.

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/wallter/trw-mcp'

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