Skip to main content
Glama
HasanJahidul

Terminal History MCP

search_history

Read-onlyIdempotent

Perform full-text search on indexed shell commands. Supports keyword and prefix queries, returning newest matches with timestamp, shell, cwd, and exit code.

Instructions

Read-only. Full-text search (SQLite FTS5, stemmed, Unicode-aware) over all indexed shell commands. Supports keyword and prefix queries — e.g. docker build, git reb*. Returns the most recent matches first, each with timestamp, shell, cwd, and exit code when available. Local index only; nothing is sent anywhere. If a query returns nothing you may need reindex first.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of matching commands to return, newest first. Default 20.
queryYesFTS5 query. Plain keywords are ANDed; append `*` for prefix match. E.g. `npm install`, `kubectl get po*`.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
countNo
resultsNo
Behavior5/5

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

Adds significant behavioral context beyond annotations: declares read-only, specifies search algorithm (FTS5, stemming, Unicode), result ordering, returned fields (timestamp, shell, cwd, exit code), and privacy guarantee (local index only). No contradictions with annotations.

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 sentences, front-loaded with core action and key features. Every sentence adds essential information without redundancy. Efficiently covers purpose, usage, details, and fallback.

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?

Given full schema coverage, annotations, and output schema existence, the description is complete. It covers what the tool does, how to use it, what to expect in return, privacy, and relationship to sibling tool, leaving no gaps for an agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema already describes both parameters (100% coverage). Description adds value by explaining query syntax with examples and clarifying that prefix matching requires an asterisk, and by noting the default limit is 20 and results are newest first.

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?

Clearly states it is a full-text search over indexed shell commands using SQLite FTS5. Specifies resource (shell history) and action (search), with details on stemming and Unicode-awareness. Differentiates from sibling 'reindex' by mentioning it as a fallback.

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?

Provides explicit examples of keyword and prefix queries, describes return fields and ordering, and advises when to use 'reindex' if no results. Does not explicitly compare to other sibling tools like command_chains or failed_commands, but context is sufficient.

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/HasanJahidul/terminal-history-mcp'

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