Skip to main content
Glama

search_threads

Read-only

Find relevant past AI coding sessions across tools using keyword or semantic search to recall prior work.

Instructions

Keyword search over the user's past AI coding sessions in every tool (Claude Code, Codex, Cursor, Gemini, Copilot, ...). One entry per thread with snippets; hybrid=true adds semantic matching.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "query": "<query>"
    },
    "name": "search_threads"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNoMax threads (default 10, max 50).
queryYesThe search query.
hybridNoAlso match semantically (fuzzy or paraphrased queries; slower).
sourcesNoSource filter, e.g. claude_code, codex, cursor, gemini, copilot, in_app. Empty = all.
include_subagentsNoInclude Claude Code subagent transcripts (hidden by default).

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.11.4
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "anyOf": [
      +    {
      +      "properties": {
      +        "coverage": {
      +          "properties": {
      +            "blindSpots": {
      +              "items": {
      +                "type": "string"
      +              },
      +              "type": "array"
      +            },
      +            "lastIndexedAt": {
      +              "type": [
      +                "integer",
      +                "null"
      +              ]
      +            },
      +            "sources": {
      +              "items": {
      +                "properties": {
      +                  "kind": {
      +                    "type": "string"
      +                  },
      +                  "threads": {
      +                    "type": "integer"
      +                  }
      +                },
      +                "required": [
      +                  "kind",
      +                  "threads"
      +                ],
      +                "type": "object"
      +              },
      +              "type": "array"
      +            }
      +          },
      +          "required": [
      +            "sources",
      +            "lastIndexedAt",
      +            "blindSpots"
      +          ],
      +          "type": [
      +            "object",
      +            "null"
      +          ]
      +        },
      +        "threads": {
      +          "items": {
      +            "properties": {
      +              "projectPath": {
      +                "type": [
      +                  "string",
      +                  "null"
      +                ]
      +              },
      +              "snippets": {
      +                "items": {
      +                  "type": "string"
      +                },
      +                "type": "array"
      +              },
      +              "source": {
      +                "type": "string"
      +              },
      +              "threadId": {
      +                "type": "integer"
      +              },
      +              "title": {
      +                "type": [
      +                  "string",
      +                  "null"
      +                ]
      +              },
      +              "ts": {
      +                "type": [
      +                  "integer",
      +                  "null"
      +                ]
      +              }
      +            },
      +            "required": [
      +              "threadId",
      +              "source",
      +              "title",
      +              "projectPath",
      +              "ts",
      +              "snippets"
      +            ],
      +            "type": "object"
      +          },
      +          "type": "array"
      +        }
      +      },
      +      "required": [
      +        "threads"
      +      ],
      +      "type": "object"
      +    },
      +    {
      +      "properties": {
      +        "notice": {
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "notice"
      +      ],
      +      "type": "object"
      +    }
      +  ],
      +  "type": "object"
      +}
  2. Changed5 schema fields changedv0.11.3
    • removedInput schema / $schema
      Removed value: -"https://json-schema.org/draft/2020-12/schema"
    • changedInput schema / properties / hybrid / description
      Previous value: -"Fuse keyword + on-device semantic search (higher recall; loads the embedding model)."New value: +"Also match semantically (fuzzy or paraphrased queries; slower)."
    • changedInput schema / properties / limit / description
      Previous value: -"Max results to return (default 20)."New value: +"Max threads (default 10, max 50)."
    • changedInput schema / properties / sources / description
      Previous value: -"Optional source filter: any of claude_code, codex, cursor, gemini, qwen,\ngoose, opencode, continue, cline, roo, kilo, in_app. Empty = all sources."New value: +"Source filter, e.g. claude_code, codex, cursor, gemini, copilot, in_app. Empty = all."
    • removedInput schema / title
      Removed value: -"SearchArgs"
  3. Changed1 schema field changedv0.6.0
    • changedInput schema / properties / sources / description
      Previous value: -"Optional source filter: any of claude_code, codex, cursor, gemini, qwen,\ngoose, opencode, continue, cline, in_app. Empty = all sources."New value: +"Optional source filter: any of claude_code, codex, cursor, gemini, qwen,\ngoose, opencode, continue, cline, roo, kilo, in_app. Empty = all sources."
  4. First observedv0.5.0

TDQS

A3.6/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true and openWorldHint=false, so the safety profile is covered and the description only needs to add context. It does add real value — per-thread result granularity with snippets, and that hybrid mode is semantically broader — but it says nothing about ranking, snippet truncation, or result ordering beyond what the annotations and output schema imply.

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 compact sentences with the scope and result shape front-loaded, then the single most consequential option. No filler, no repetition of the title or name.

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 five fully documented parameters, annotations, and an output schema, the description only owes the agent scope and the semantic-search switch, both of which it delivers. The remaining gap is sibling disambiguation against the crowded search/recall family, which keeps it from a 5.

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%, so the schema already explains limit, query, hybrid, sources, and include_subagents. The description's only parameter-level contribution is restating that hybrid enables semantic matching, which is already in the schema; no new syntax, format, or tradeoff detail is added.

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: keyword search over the user's past AI coding sessions across all tools, with named examples (Claude Code, Codex, Cursor, Gemini, Copilot) and the return shape ('one entry per thread with snippets'). It also implicitly scopes itself against the more narrow sibling search_current_project by saying 'every tool', though it never names that 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 Guidelines3/5

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

Usage is implied rather than stated: the cross-tool scope suggests using this when a search should span all tools, and 'hybrid=true adds semantic matching' hints at when to enable the slower path. There is no explicit when-not guidance or named alternative (e.g. search_current_project, recent_threads) to route the agent between the many search-like siblings.

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