Skip to main content
Glama
MySQL Automation MCP Server

MySQL Automation MCP Server

Get Query History

get_query_history

Retrieve recent SQL queries from the local audit log and filter by tool, status, or query type to review model actions, verify outputs, and support post-mortem inspection.

Instructions

Retrieve recent SQL queries executed by the assistant from the local audit log. Useful for reviewing model actions, verifying hallucinations, and post-mortem inspection.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "get_query_history"
  }
}

Input Schema

NameRequiredDescriptionDefault
toolNoOptional tool filter ('execute_query', 'execute_mutation', 'explain_query', 'export_query_results').
limitNoNumber of recent queries to return (default: 20, max: 200).
statusNoOptional status filter ('SUCCESS', 'FAILED', 'BLOCKED_BY_SAFETY').
query_typeNoOptional type filter ('READ', 'MUTATION', 'EXPLAIN', 'EXPORT').

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.4/5.0
Behavior3/5

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

With no annotations supplied, the description must carry the behavioral burden. It discloses that data comes from a local audit log and that only recent queries are returned, which is useful scope context. But it omits whether the operation is read-only (implied by 'retrieve' but not stated), paging behavior, ordering, or whether the log can be cleared. Adequate but incomplete.

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?

Two tight sentences: the first names the action and the data source, the second lists concrete motivations. Front-loaded and free of repetition. Slightly more could be said about filtering behavior, but nothing in the current text is wasted.

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

Completeness3/5

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

The tool has four optional filter parameters and an output schema, which reduces the description's burden, and it covers the core purpose and data source. However, for an unannotated tool the description should at least confirm this is a non-destructive read and clarify how the filters compose — that gap keeps it at minimum-viable.

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%, with every parameter, its default, enum values, and limits documented in the schema. The description adds no parameter-level detail (e.g., how filters combine, whether limit interacts with status filtering), so the 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?

States a specific verb and resource: 'Retrieve recent SQL queries executed by the assistant from the local audit log.' This clearly distinguishes it from siblings like execute_query or explain_query, which perform queries rather than report on past ones. It's not a 5 because the description doesn't explicitly name an alternative tool for comparison.

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 description gives implied usage contexts — reviewing model actions, verifying hallucinations, post-mortem inspection — which suggest when to reach for this tool. However, it doesn't explicitly state when NOT to use it or point to alternatives (e.g., use execute_query to run a new query). Guidance is present but implicit.

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