Skip to main content
Glama

analyze-missing-indexes

analyze-missing-indexes
Read-onlyIdempotent

Suggests indexes for simple single-table SELECT predicates and ORDER BY terms after checking existing catalog indexes. Offers heuristic advice only; never runs queries or applies DDL.

Instructions

Suggests indexes for simple single-table SELECT predicates/order terms after checking existing catalog indexes, including primary keys. Heuristic advice only; never executes the query or applies index DDL.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYesSQL query to analyze for missing indexes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
errorNoFailure information; present when success is false
resultNoThe legacy JSON payload; present for completed operations and partial batches
successYesFalse for tool failures, including partially failed batches

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv2.12.0
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • removedInput schema / additionalProperties
      Removed value: -false
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$defs": {
      +    "__schema0": {
      +      "anyOf": [
      +        {
      +          "type": "string"
      +        },
      +        {
      +          "type": "number"
      +        },
      +        {
      +          "type": "boolean"
      +        },
      +        {
      +          "type": "null"
      +        },
      +        {
      +          "items": {
      +            "$ref": "#/$defs/__schema0"
      +          },
      +          "type": "array"
      +        },
      +        {
      +          "additionalProperties": {
      +            "$ref": "#/$defs/__schema0"
      +          },
      +          "propertyNames": {
      +            "type": "string"
      +          },
      +          "type": "object"
      +        }
      +      ]
      +    }
      +  },
      +  "$schema": "https://json-schema.org/draft/2020-12/schema",
      +  "additionalProperties": false,
      +  "properties": {
      +    "error": {
      +      "additionalProperties": false,
      +      "description": "Failure information; present when success is false",
      +      "properties": {
      +        "details": {
      +          "additionalProperties": {
      +            "$ref": "#/$defs/__schema0"
      +          },
      +          "propertyNames": {
      +            "type": "string"
      +          },
      +          "type": "object"
      +        },
      +        "message": {
      +          "type": "string"
      +        },
      +        "type": {
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "message",
      +        "type"
      +      ],
      +      "type": "object"
      +    },
      +    "result": {
      +      "additionalProperties": false,
      +      "description": "The legacy JSON payload; present for completed operations and partial batches",
      +      "properties": {
      +        "error": {
      +          "type": "string"
      +        },
      +        "missingIndexes": {
      +          "items": {
      +            "type": "string"
      +          },
      +          "type": "array"
      +        },
      +        "recommendations": {
      +          "items": {
      +            "type": "string"
      +          },
      +          "type": "array"
      +        },
      +        "success": {
      +          "type": "boolean"
      +        }
      +      },
      +      "required": [
      +        "missingIndexes",
      +        "recommendations",
      +        "success"
      +      ],
      +      "type": "object"
      +    },
      +    "success": {
      +      "description": "False for tool failures, including partially failed batches",
      +      "type": "boolean"
      +    }
      +  },
      +  "required": [
      +    "success"
      +  ],
      +  "type": "object"
      +}
  2. First observed

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already declare readOnly/idempotent/non-destructive, but the description adds real signal beyond them: it explains it checks existing catalog indexes (including primary keys) and stresses 'Heuristic advice only; never executes the query or applies index DDL.' That clarifies the advisory nature and absence of side effects against the openWorldHint=false context.

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?

Two tightly written sentences, front-loaded with the core action and immediately followed by the safety/scope caveat. No filler and every clause earns its place.

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?

With an output schema present the description need not explain return values, and annotations cover the safety profile. The description still supplies scope, the advisory-only caveat, and internal behavior (catalog index check), leaving only minor gaps such as a sibling alternative.

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% and there is only one documented parameter ('SQL query to analyze for missing indexes'), so the schema does the heavy lifting. The description adds no syntax, format, or limitation detail about the sql input beyond what the schema already states, matching the baseline 3.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description gives a specific verb ('Suggests indexes') plus a tightly scoped resource ('simple single-table SELECT predicates/order terms'), so the agent knows exactly what class of queries qualifies. It does not name a sibling to contrast against (e.g. get-table-indexes, analyze-query-performance), so it stops short of full sibling differentiation.

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

Usage Guidelines3/5

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

The scope constraint ('simple single-table SELECT predicates/order terms') implies when the tool does and does not apply, which is useful routing guidance. However, no alternative is named and there is no explicit 'use X instead when...' exclusion, so usage is inferred rather than stated.

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