Skip to main content
Glama
kvnpetit

SRC (Structured Repo Context)

by kvnpetit

index_codebase

index_codebase
DestructiveIdempotent

Create vector embeddings to enable semantic code search across 55 languages and 99 file extensions. Run once per project before searching, then use incremental updates for changes.

Instructions

Index a codebase for semantic code search. USE THIS FIRST before search_code. Required once per project - creates vector embeddings for 55 configured language modes across 99 extensions. After initial indexing, use update_index for incremental updates.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
forceNoForce re-indexing even if index exists
excludeNoAdditional glob patterns to exclude
directoryNoPath to the directory to index (defaults to current directory).
concurrencyNoNumber of files to process in parallel (default: 4)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataNo
metaYes
errorNo
messageNo
successYes
schema_versionYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv2.0.0
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • changedInput schema / properties / concurrency / maximum
      Previous value: -9007199254740991New value: +32
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "https://json-schema.org/draft/2020-12/schema",
      +  "additionalProperties": false,
      +  "properties": {
      +    "data": {
      +      "additionalProperties": false,
      +      "properties": {
      +        "chunksCreated": {
      +          "maximum": 9007199254740991,
      +          "minimum": 0,
      +          "type": "integer"
      +        },
      +        "directory": {
      +          "type": "string"
      +        },
      +        "errors": {
      +          "items": {
      +            "type": "string"
      +          },
      +          "type": "array"
      +        },
      +        "filesIndexed": {
      +          "maximum": 9007199254740991,
      +          "minimum": 0,
      +          "type": "integer"
      +        },
      +        "languages": {
      +          "additionalProperties": {
      +            "maximum": 9007199254740991,
      +            "minimum": 0,
      +            "type": "integer"
      +          },
      +          "propertyNames": {
      +            "type": "string"
      +          },
      +          "type": "object"
      +        }
      +      },
      +      "required": [
      +        "directory",
      +        "filesIndexed",
      +        "chunksCreated",
      +        "languages",
      +        "errors"
      +      ],
      +      "type": "object"
      +    },
      +    "error": {
      +      "type": "string"
      +    },
      +    "message": {
      +      "type": "string"
      +    },
      +    "meta": {
      +      "additionalProperties": false,
      +      "properties": {
      +        "bounded": {
      +          "const": true,
      +          "type": "boolean"
      +        },
      +        "confidence": {
      +          "maximum": 1,
      +          "minimum": 0,
      +          "type": "number"
      +        },
      +        "coverage": {
      +          "enum": [
      +            "precise",
      +            "approximate",
      +            "unknown"
      +          ],
      +          "type": "string"
      +        },
      +        "generated_at": {
      +          "type": "string"
      +        },
      +        "index_freshness": {
      +          "enum": [
      +            "fresh",
      +            "stale",
      +            "unknown"
      +          ],
      +          "type": "string"
      +        },
      +        "instruction_signals": {
      +          "additionalProperties": false,
      +          "properties": {
      +            "count": {
      +              "maximum": 9007199254740991,
      +              "minimum": 0,
      +              "type": "integer"
      +            },
      +            "detected": {
      +              "type": "boolean"
      +            },
      +            "kinds": {
      +              "items": {
      +                "enum": [
      +                  "instruction_override",
      +                  "authority_spoofing",
      +                  "tool_execution_request",
      +                  "secret_exfiltration_request",
      +                  "delimiter_spoofing",
      +                  "hidden_unicode",
      +                  "encoded_instruction"
      +                ],
      +                "type": "string"
      +              },
      +              "type": "array"
      +            },
      +            "scan_truncated": {
      +              "type": "boolean"
      +            },
      +            "scanned_bytes": {
      +              "maximum": 9007199254740991,
      +              "minimum": 0,
      +              "type": "integer"
      +            },
      +            "signals": {
      +              "items": {
      +                "additionalProperties": false,
      +                "properties": {
      +                  "column": {
      +                    "maximum": 9007199254740991,
      +                    "minimum": 0,
      +                    "type": "integer"
      +                  },
      +                  "confidence": {
      +                    "maximum": 1,
      +                    "minimum": 0,
      +                    "type": "number"
      +                  },
      +                  "kind": {
      +                    "enum": [
      +                      "instruction_override",
      +                      "authority_spoofing",
      +                      "tool_execution_request",
      +                      "secret_exfiltration_request",
      +                      "delimiter_spoofing",
      +                      "hidden_unicode",
      +                      "encoded_instruction"
      +                    ],
      +                    "type": "string"
      +                  },
      +                  "line": {
      +                    "exclusiveMinimum": 0,
      +                    "maximum": 9007199254740991,
      +                    "type": "integer"
      +                  },
      +                  "offset": {
      +                    "maximum": 9007199254740991,
      +                    "minimum": 0,
      +                    "type": "integer"
      +                  },
      +                  "reason": {
      +                    "type": "string"
      +                  },
      +                  "source": {
      +                    "type": "string"
      +                  }
      +                },
      +                "required": [
      +                  "kind",
      +                  "line",
      +                  "column",
      +                  "offset",
      +                  "confidence",
      +                  "reason"
      +                ],
      +                "type": "object"
      +              },
      +              "type": "array"
      +            }
      +          },
      +          "required": [
      +            "detected",
      +            "count",
      +            "kinds",
      +            "signals",
      +            "scanned_bytes",
      +            "scan_truncated"
      +          ],
      +          "type": "object"
      +        },
      +        "local_only": {
      +          "const": true,
      +          "type": "boolean"
      +        },
      +        "provenance": {
      +          "enum": [
      +            "local-analysis",
      +            "local-filesystem",
      +            "local-index",
      +            "local-lsp"
      +          ],
      +          "type": "string"
      +        },
      +        "source_is_untrusted": {
      +          "type": "boolean"
      +        },
      +        "source_revision": {
      +          "type": "string"
      +        },
      +        "truncated": {
      +          "type": "boolean"
      +        }
      +      },
      +      "required": [
      +        "generated_at",
      +        "local_only",
      +        "bounded",
      +        "provenance"
      +      ],
      +      "type": "object"
      +    },
      +    "schema_version": {
      +      "const": 1,
      +      "type": "number"
      +    },
      +    "success": {
      +      "type": "boolean"
      +    }
      +  },
      +  "required": [
      +    "schema_version",
      +    "success",
      +    "meta"
      +  ],
      +  "type": "object"
      +}
  2. First observedv1.0.3

TDQS

A4.5/5.0
Behavior4/5

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

The annotations already convey destructive and idempotent behavior; the description adds useful context by explaining that the tool creates vector embeddings across 55 language modes and 99 extensions and that update_index should be used afterward for increments. It does not belabor the destructive nature because the annotation already covers it.

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?

Three sentences with no filler. The first sentence states the core action, the second emphasizes the required ordering, and the third gives the incremental-update alternative; every sentence earns its place.

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?

For an indexing operation with a full output schema, complete parameter documentation, and annotations covering safety/idempotency, the description provides all essential operational context: what it does, when it is required, and what to use afterward. Nothing critical is missing.

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 description coverage is 100%, so all four parameters (force, exclude, directory, concurrency) are already documented in the schema. The description adds no parameter-level detail, which is acceptable but means the description contributes no extra semantic value here.

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 a codebase') plus the purpose ('for semantic code search'), and explicitly tells the agent to use this before search_code. It also distinguishes itself from update_index by framing this as the initial one-time indexing step.

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?

Provides explicit ordering guidance ('USE THIS FIRST before search_code'), says how often it is needed ('Required once per project'), and names the correct follow-up tool for later changes ('use update_index for incremental updates'). This leaves no ambiguity about when to invoke it.

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