Skip to main content
Glama

Suggest a MySQL index

mysql_index_suggestions
Read-only

Generate ALTER TABLE ADD INDEX SQL for a MySQL table column, plus a composite variant and EXPLAIN guidance, to fix missing-index or full table scan findings.

Instructions

Generates the exact ALTER TABLE ADD INDEX SQL for a MySQL table column, including a composite variant and EXPLAIN guidance to verify the index is used. Call this when the analyzer flags a missing MySQL index or full table scan finding. Does not verify whether the index already exists.

Input Schema

NameRequiredDescriptionDefault
tableYesMySQL table name
columnYesColumn name to index

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.21.0
  2. Removedv0.19.7
  3. First observedv0.1.0

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and openWorldHint=false, and the description is consistent with that (it only generates SQL text). It adds real context beyond the annotations: the output includes a composite variant plus EXPLAIN verification guidance, and it explicitly disclaims existence checking.

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 short sentences, front-loaded with what is produced, then when to call it, then the caveat. No filler or restatement of the title.

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?

There is no output schema, but the description compensates by describing the deliverable (ALTER TABLE statement, composite variant, EXPLAIN guidance), which is exactly what an agent needs to know before invoking it. Nothing material is missing for a two-parameter read-only generator.

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% with two well-described required parameters (table, column), so the schema already carries the parameter semantics. The description's phrase 'for a MySQL table column' merely restates that pairing and adds no format or constraint detail, making 3 the correct baseline.

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 artifact: generates the exact ALTER TABLE ADD INDEX SQL for a MySQL table column. The MySQL qualifier cleanly separates it from the sibling index tools (postgres_index_suggestions, suggest_mongo_index, suggest_gsi) without needing to open 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 trigger: 'Call this when the analyzer flags a missing MySQL index or full table scan finding.' It also states one boundary condition (does not check for an existing index), but it never names an alternative tool for non-MySQL engines, leaving that routing to the name alone.

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