Skip to main content
Glama

cachly — Explain it once. Every AI knows it.

index_project

Index local source files into the cachly semantic cache so AI assistants can use semantic_search to find relevant files instead of re-reading the whole codebase every time. Walks a directory recursively, reads each matching file, and stores a summary + path as a semantic cache entry (prompt = file path + content excerpt, value = relative path). Requires an embedding provider (OPENAI_API_KEY or CACHLY_EMBED_PROVIDER + key). Run once, then re-run after major refactors. TTL=86400 (24h) keeps entries fresh.

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": {
      "dir": "<dir>"
    },
    "name": "index_project"
  }
}

Input Schema

NameRequiredDescriptionDefault
dirYesAbsolute path to the directory to index (e.g. /Users/you/myproject/src)
ttlNoTTL in seconds for indexed entries (default: 86400 = 24 h)
max_filesNoMaximum number of files to index (default: 100)
namespaceNoSemantic namespace to store under (default: cachly:sem:code)
extensionsNoFile extensions to include (default: ["ts","js","go","py","java","rs","md","kt","swift"])
instance_idNoUUID of the cachly instance
summary_charsNoCharacters to use as summary per file (default: 1200)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.9/5.0
Behavior3/5

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

No annotations are supplied, so the description carries the full burden. It does well on prerequisites ('Requires an embedding provider (OPENAI_API_KEY or CACHLY_EMBED_PROVIDER + key)') and on the write shape (walks recursively, reads files, stores prompt = path + excerpt, value = relative path), plus TTL freshness. It omits whether re-indexing overwrites or duplicates existing entries, what happens on partial failure, and roughly what the operation costs in time/embedding calls for a large tree — material gaps for a batch mutation with zero annotation coverage.

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?

Four sentences, front-loaded with purpose and the downstream benefit before mechanics and prerequisites. Minor redundancy: the 86400/24h TTL value is stated as a fixed fact even though it is a per-call parameter, and could be trimmed.

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 7-parameter batch-write tool with no annotations and no output schema, the description covers purpose, prerequisites, storage semantics, and invocation cadence. What remains missing is return information (files indexed vs skipped, errors) and overwrite/idempotency behavior, which the absent output schema would otherwise have carried.

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%, so the schema already documents all seven parameters including defaults and the extensions list. The description reinforces ttl (24h freshness) and indirectly explains summary_chars via 'stores a summary + path,' but adds nothing about namespace, instance_id, or max_files beyond what the schema states. Baseline 3 applies when the schema does the heavy lifting.

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 ('Index local source files into the cachly semantic cache') and immediately gives the downstream purpose, naming the sibling that consumes the result ('so AI assistants can use semantic_search'). An agent can distinguish this from semantic_search and the brain_* siblings without opening any schema.

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?

Gives an explicit lifecycle instruction: 'Run once, then re-run after major refactors,' which tells the agent when to invoke it and when to re-invoke. It also implies the prerequisite chain (index before semantic_search) but never states a when-not-to-use case, such as preferring cache_get for already-known files.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.