Skip to main content
Glama

Read your query history

get_query_history
Read-onlyIdempotent

Get your recent successful query history with natural language context. Use this to find previous queries that answered similar questions and reuse their SQL patterns. Only shows your own queries (private to your account). Returns the natural language question, SQL, execution details, and optional feedback.

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
limitNoMaximum number of queries to return (default: 20, max: 100)
sinceNoOnly return queries after this date (ISO 8601 format, e.g., '2024-01-01')
tablesNoComma-separated list of table names to filter by (e.g., 'orders,users')
datasource_idNoOnly return queries that ran against this datasource (UUID). Use this to disambiguate history when a project spans multiple datasources.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4/5.0
Behavior4/5

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

Annotations already establish the safe-read profile (readOnly, idempotent, non-destructive, closed-world), and the description adds beyond that: only successful queries are returned, results are private to the caller's account, and the payload includes the NL question, SQL, execution details, and optional feedback. That privacy scoping and success-filtering is exactly the kind of behavior annotations cannot convey.

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 it returns, then when to use it, then scope and payload. No redundant restatement of the title and no wasted clauses.

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 no output schema, the description usefully enumerates the return fields (NL question, SQL, execution details, feedback) and states the privacy/success filters. Filters are delegated to a fully documented schema, so little an agent needs is missing.

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 each of the four optional filters documented in-schema including formats and defaults. The description adds only the generic notion of 'recent' and privacy filtering, so the baseline 3 is appropriate.

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 ('Get your recent successful query history') plus meaningful scope qualifiers: successful only, recent, and private to the caller's account. This clearly separates it from siblings like query and list_query_suggestions, though it does not name a sibling explicitly.

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 a concrete use case — find prior queries answering similar questions and reuse their SQL patterns. That is clear guidance for the agent. It stops short of explicit when-not-to-use or naming an alternative tool for fresh execution, so it is not a 5.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources