Skip to main content
Glama

watch_directory

Monitors a directory for file changes and automatically updates the local code index within seconds, batching rapid edits so AI search stays current.

Instructions

Start watching a directory for changes and auto-sync the index.

When files are modified, created, or deleted, the index will automatically
update within a few seconds (debounced to batch rapid changes).

Args:
    directory: Path to the directory to watch

Returns:
    Status message

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "directory": "<directory>"
    },
    "name": "watch_directory"
  }
}

Input Schema

NameRequiredDescriptionDefault
directoryYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.4/5.0
Behavior3/5

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

With no annotations, the description carries the full burden, and it does disclose genuinely useful behavior: updates fire on modify/create/delete, land within a few seconds, and are debounced to batch rapid changes. It omits key operational facts — whether the watch is persistent across sessions, how to stop it (the unwatch_directory sibling exists but is unmentioned), what happens if the directory is already watched, and what the returned 'Status message' contains beyond the output schema.

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?

Front-loaded opening sentence followed by short Args/Returns blocks; no wasted wording. The 'Returns: Status message' line is near-vacuous given an output schema exists, but it costs little.

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?

The output schema covers return values and the debounce/timing behavior is explained, so the core contract is present. However, for a stateful background-mode tool with zero annotations and zero schema description coverage, the absence of lifecycle details (stopping the watch, error conditions, precedence over manual sync_index calls) leaves notable gaps.

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 0%, so the description must compensate for a single parameter, and it only restates it as 'Path to the directory to watch'. It adds no detail on whether an absolute or relative path is required, whether the directory must already exist, or whether it must be inside an indexed root.

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?

States a specific verb and resource ('Start watching a directory') plus the effect ('auto-sync the index'), which cleanly separates it from index_directory and sync_index. An agent can tell this begins a persistent watch rather than performing a one-shot index operation.

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

Usage Guidelines2/5

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

No when-to-use or when-not-to-use guidance is given; the description never mentions index_directory, sync_index, or unwatch_directory as alternatives. The agent must infer that this is the continuous-mode counterpart to one-shot indexing entirely on its own.

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