Skip to main content
Glama

create_index

Create a database index on MySQL/MariaDB tables. Includes unique index support, dry-run preview, and reversible undo for rollback.

Instructions

[WRITE][risk=medium] Create an index. Reversible: undo drops the created index.

The created (table, name) is returned so the harness records an undo that drops exactly this index. Pass dry_run=True to preview. Alternatively pass definition (a captured CREATE INDEX statement — this is how drop_index's undo descriptor replays) INSTEAD of table/columns.

Args: table: Table to index (optionally schema-qualified). Required unless definition is given. columns: Column names to index. Required unless definition is given. name: Index name (auto-generated from table+columns when omitted). unique: Create a UNIQUE index. definition: A full CREATE [UNIQUE] INDEX statement to execute verbatim (shape-validated). Mutually exclusive with table/columns. dry_run: If True, preview without creating. target: Target name from config; omit for the default.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameNo
tableNo
targetNo
uniqueNo
columnsNo
dry_runNo
definitionNo
Behavior5/5

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

With no annotations, the description carries the full burden. It discloses the write risk ('[WRITE][risk=medium]'), reversibility (undo drops the created index), the return value used for undo recording, dry-run preview behavior, and shape validation for the definition input. This is substantial behavioral transparency.

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 well-structured with a brief overview and sectioned Args list. It is slightly redundant ('Pass dry_run=True to preview' and then 'dry_run: If True, preview without creating') but every line generally earns its place given the parameter count.

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?

Given no output schema, the description explains the return value (created table/name for undo) and the two invocation paths. It could add details about error handling or behavior on existing indexes, but for a creation tool with this many parameters, it is largely complete.

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?

Schema description coverage is 0%, and the description compensates fully by detailing every parameter: table, columns, name, unique, definition, dry_run, target. It explains requirements, defaults, and mutual exclusivity, far exceeding what the bare JSON schema provides.

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 description opens with a clear verb+resource statement: 'Create an index.' It distinguishes the tool's capability from siblings by explaining the two construction modes (table/columns or definition) and referencing drop_index's undo replay, making the purpose unambiguous.

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?

The description provides context on when to use the table/columns path versus the definition path, notes mutual exclusivity, and mentions dry_run for preview. However, it does not explicitly contrast with sibling tools beyond referencing drop_index's undo mechanism, so usage guidance is strong but not fully explicit on alternatives.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/AIops-tools/MySQL-AIops'

If you have feedback or need assistance with the MCP directory API, please join our Discord server