Skip to main content
Glama
syrian963

django-chainsaw-mcp

by syrian963

missing_indexes

Read-onlyIdempotent

Scans Django source code to detect fields used for filtering or sorting that lack database indexes, reporting occurrence counts so you can decide where to add indexes before shipping.

Instructions

Fields the code filters or sorts on that carry no index.

Runtime tools answer this by watching real traffic, which only ever covers
the paths traffic reached. Reading the source covers every path in the
repository, works with no database and no traffic, and can run on a branch
before it ships.

The trade is that it cannot weigh anything: a filter on a forty row table
looks like one on a forty million row table. It reports where an index is
missing and how often the code asks for it, and leaves the decision to
somebody who knows the row counts.

Args:
    search_path: directory to scan. Defaults to the project path.
    min_occurrences: only report a field asked for at least this often.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
search_pathNo
min_occurrencesNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.3

TDQS

A4.9/5.0
Behavior5/5

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

Annotations already mark the tool read-only and idempotent; the description adds valuable behavioral context: it statically reads source, needs no database/traffic, reports how often a field is queried, and deliberately leaves weighting decisions to the user. No contradictions 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.

Conciseness4/5

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

The description is longer than average but every sentence carries meaning: the definition, the contrast with runtime tools, the limitation, and parameter docs. The core purpose is front-loaded, though the runtime-tools paragraph could be slightly tighter.

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 an output schema provided, annotations, a complete parameter explanation, and a clear behavioral model including limitations, an agent has enough context to invoke this tool correctly and interpret its results. Nothing essential is missing.

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

Parameters5/5

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

The schema has no descriptions for the parameters, but the description compensates fully: search_path is documented as the directory to scan with a project-path default, and min_occurrences is documented as the frequency threshold for reporting. This gives an agent everything needed to set both.

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 first sentence, 'Fields the code filters or sorts on that carry no index,' states exactly what the tool returns and ties directly to the tool name. The rest of the description clarifies it reports missing indexes from source code, distinguishing it from runtime-based tools.

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?

The description explicitly contrasts runtime tools with this source-based approach: it works with no database and no traffic, can run on a branch before it ships, and covers every path. It also names the key trade-off (cannot weigh importance) so an agent knows when to prefer or avoid this tool.

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