Skip to main content
Glama

locate

Find a coding agent session by UUID, ID prefix, or title and get its location plus ready-to-run read and resume commands.

Instructions

Find a session across all agents by uuid / id-prefix / title — locate.

One call answers "I remember a session — where does it live and how do I read it?". needle is a full uuid, an id prefix (e.g. the 8-hex head), or a case-insensitive title substring. A thin preset over the existing per-parser inventory (the same list_sessions walk — zero new scanning code) with a deterministic algorithm inside: prefix-match on uuid/path-stem OR substring-match on title, ranked by last activity (mtime) descending. Each match carries where it lives (path / agent / project_dir / date / size_bytes), the honest local-content claim readable (false for a reference-only stub whose transcript is not on this machine), and the ready-to-run commands: read_command (ai-r read <uuid> --agent <agent>) + resume_command (F2.2 — text only, never executed).

limit bounds the emitted list (0 = no cap; count keeps the full total, truncated flags the cut). Zero matches → an honest empty with closest-title suggestions + diagnostics — never a fabricated match.

web=true (v1, honest scope) adds web sessions KNOWN LOCALLY only: materialized hook-export files ($SW_HOME/web-sessions, default ~/.session-watch/web-sessions) and ~/.claude.json → projects[*].lastSessionId teleport stubs (id known, transcript NOT local — content_local: false). The fuller per-repo teleport-picker sweep needs a PTY and is a documented follow-up, not guessed here.

Thin wrapper over :func:ai_r.locate.locate (ValueError{"error": "invalid_argument"}).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
webNo
agentNo
limitNo
needleYes
redactNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

With no annotations, the description carries the full transparency burden and exceeds expectations. It discloses the deterministic matching algorithm, ranking by last activity, the exact match fields (path, agent, project_dir, date, size_bytes), the honest 'readable' flag, the non-executed resume_command, limit/count/truncated behavior, zero-match suggestions instead of fabricated results, web=true's "honest scope", and the ValueError-to-error mapping.

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?

The description is long but every sentence adds value: algorithm, result fields, command generation, limit semantics, empty-result behavior, web scope, and error mapping. It is front-loaded with the core purpose and then systematically expands into necessary edge-case detail without fluff.

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?

For a 5-parameter tool with no annotations and no schema descriptions, the description is remarkably complete. It covers search semantics, result structure, command generation, output limiting, zero-match handling, web mode limitations, and exception mapping. The only minor omission is the semantics of 'agent' and 'redact', but the overall context is sufficient for correct invocation.

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 description coverage is 0%, but the description richly explains needle (full uuid, id-prefix, case-insensitive title substring), limit (0 = no cap, count/truncated flags), and web (local-only known entries, hook files, teleport stubs with content_local). However, 'agent' and 'redact' parameters are not explained anywhere, leaving a clear gap despite the otherwise strong compensation.

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?

The opening line states the tool's exact purpose: "Find a session across all agents by uuid / id-prefix / title". It distinguishes itself from siblings like list_sessions and read_session by promising to answer where a session lives and how to read it, while returning ready-to-run commands.

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?

The description frames the core use case: "I remember a session — where does it live and how do I read it?". It explicitly positions the tool as a preset over the existing list_sessions walk and clarifies current limitations (e.g., the fuller teleport-picker sweep requires a PTY and is a documented follow-up), providing clear when-to-use and scope boundaries.

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/pro-target/ai-r'

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