Skip to main content
Glama

Install the PreToolUse hook

install_hook
Destructive

Install a PreToolUse hook that warns only when an edit resends 25+ lines that an indexed symbol covers or a whole file over 12KB is read, preventing context bloat. Supports Claude/Copilot scopes.

Instructions

Wire slimdex's write discipline into the CLIENT, which registering the MCP server cannot do — the protocol has no mechanism for a server to add a hook, so this is the one call that closes the gap. Writes a PreToolUse hook that speaks up ONLY when an edit re-sends 25+ lines that an indexed symbol actually covers, or a whole file over 12KB is read. Merges rather than clobbers, is idempotent, and prints exactly what changed. scope: claude-global (default, all your repos) | claude-local | claude-project | copilot-global (VS Code, all your repos) | copilot-project (.github/hooks, COMMITTED). Use uninstall:true to remove it.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scopeNoWhich config to write. Default claude-global; use copilot-global for a VS Code-only setup.
uninstallNoRemove the hook instead of adding it.
Behavior5/5

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

Despite annotations already indicating destructive behavior (destructiveHint:true), the description adds rich context: it writes a PreToolUse hook, merges rather than clobbers, is idempotent, prints exactly what changed, and specifies the exact conditions under which the hook speaks up. No contradiction with annotations.

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 dense but every sentence earns its place: it covers purpose, why it's needed, behavior, scope options, and uninstall. It is front-loaded with the main action and flows logically without any fluff.

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

Completeness5/5

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

With only two parameters and no output schema, the description is fully complete. It explains what the tool does, why it's the only way, how it behaves, what it outputs, and all configuration choices. There are no gaps for the agent to guess.

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 already covers both parameters fully (100% coverage), but the description adds value by clarifying the default scope and when to use copilot-global vs other scopes. It also reinforces the uninstall parameter's purpose. This goes beyond simple schema repetition.

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 clearly states the tool installs a PreToolUse hook and explains the specific niche (closing the protocol gap where MCP servers cannot add hooks). It distinguishes this from all sibling tools, which are read/search/save tools, by being the only installation mechanism.

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?

It explicitly explains why this tool is needed (the protocol limitation), when to use it (to enforce write discipline), and provides scope choices with defaults and an uninstall option. It gives clear context for selecting copilot-global for VS Code, making the usage guidance strong.

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/Siddhukaushik/slimdex-mcp'

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