Skip to main content
Glama

Optimize tables

db_optimize_table

Run OPTIMIZE TABLE on one or more database tables to reclaim storage and refresh indexes. Provide the database and table names to target.

Instructions

Run OPTIMIZE TABLE on one or more tables of a database.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tablesYesTable names, e.g. ["wp_posts"]. Use db_tables to discover them.
db_nameYesDatabase name.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.1-alpha.0

TDQS

C2.9/5.0
Behavior2/5

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

Annotations already declare readOnlyHint=false, destructiveHint=false, idempotentHint=false, and openWorldHint=true, so the safety profile is covered. The description adds nothing beyond that: it does not mention that OPTIMIZE TABLE rebuilds/reclaims space, may lock or block the table during execution, or that the operation is repeatable but not free. For a mutation on live database tables this is a real gap.

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?

A single front-loaded sentence with no filler or redundancy; the operation and target are stated immediately. It is appropriately sized, though its brevity reflects under-specification rather than disciplined economy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a mutating table-maintenance tool with no output schema, the description should at least say what optimizing accomplishes, whether it locks/affects availability, and how it differs from repair. None of that is present, so the agent lacks the operational context needed to call it safely and correctly.

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% for both parameters, including the table-name example and the db_tables discovery pointer, so the schema carries the semantic load. The description only echoes the plural scope ('one or more tables'), adding no format, ordering, or multi-database details beyond the schema. Baseline 3 applies.

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 names a specific operation (OPTIMIZE TABLE) and its resource (one or more tables of a database), so the agent knows exactly what will be executed. However, it does not distinguish itself from the closely related sibling db_repair_table, leaving the choice between table-maintenance tools to inference.

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

Usage Guidelines2/5

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

There is no guidance on when to optimize versus repair (db_repair_table), no prerequisites such as table accessibility or minimum privileges, and no statement of whether the tables should be offline. The only hint about discovery (use db_tables) lives in the schema, not the description.

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