Skip to main content
Glama

recent_commands

Retrieve past shell commands, newest first, optionally scoped to a directory or executor to see what just happened.

Instructions

The most recently recorded commands, newest first, optionally scoped to a directory or executor. Good for 'what just happened here'. For 'what is this session doing' call resolve_current_agent_session first — recent_commands has no notion of which session is yours and will happily return another project's work.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
afterNoOnly commands at or after this time: today, yesterday, N minutes ago, N hours ago, N days ago, N weeks ago, YYYY-MM-DD, or an ISO 8601 date-time such as 2026-10-18T10:00:00Z or 2026-10-18T10:00:00+05:30 (no offset means local time)
limitNoMax rows in this page (default: 20)
detailNoAdd directory, duration, executor and session to each row (default: false)
offsetNoRows to skip; pass the response's next_offset to page forward
executorNoFilter by executor (e.g. claude-code, cursor)
directoryNoFilter to commands run in this directory

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations, the description carries the full burden, and it does disclose a genuinely important behavior: the tool has no session awareness and will return another project's work. That is a real trap an agent would otherwise hit. It still omits other behavioral context (permissions/auth, what 'recorded' excludes, return volume), so it falls short of full disclosure.

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?

Two sentences, zero filler, with the core behavior front-loaded and the caveat/routing advice following. The em-dash clause is dense but each clause adds a distinct fact.

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?

For a 6-parameter, annotation-free read tool with no output schema, the description covers purpose, ordering, scoping, and the session gotcha. It does not describe the returned fields or the paging contract, though the schema's offset description nods at next_offset, leaving a minor gap.

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%, and each parameter (after, limit, offset, detail, executor, directory) is fully documented in the schema. The description only reconfirms directory/executor scoping without adding syntax, format, or interaction details, so the baseline 3 applies.

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?

States a specific resource (recorded commands) with an explicit ordering guarantee (newest first) and optional scoping by directory or executor. It is clearly distinguishable from siblings like search_commands and list_agent_sessions without opening any schema.

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

Usage Guidelines5/5

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

Gives an explicit use case ('what just happened here') and an explicit alternative with the condition that selects it: call resolve_current_agent_session first when asking 'what is this session doing'. The routing rationale (this tool has no session notion) is spelled out.

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