Skip to main content
Glama

session_search

Read-only

Search the messages of every session you can see with a regular expression. Sessions come back best match first, each with its matching messages as snippets; open a match in context with session.history.list from its seq. The pattern is a JavaScript RegExp with the u flag, which differs from ripgrep: \w, \d and \b are ASCII-only, and there is no leading (?i). fixedStrings matches the pattern as plain text. Case follows smart case: case-insensitive unless the pattern spells an uppercase letter; caseSensitive overrides it. An index finds candidates by words, from the start of a word only, so the pattern must require a word that starts a word in the text: "ploy" does not find "deploy", and a pattern with no such word (\d{3}) is refused unless sessionId names one session to read whole. A word longer than 31 UTF-8 bytes is found by its first 31 bytes only, and near that cut a letter shorter lowercased than as written (the Kelvin sign, İ) can miss. Case-insensitive search finds a word by its lowercase spelling, so letters JavaScript treats as one (σ/ς, s/ſ, µ/μ) are different to the index. Long messages are indexed in chunks of about 8 KiB, and a match that spans two chunks can be missed. Only text a reader sees by default is searched: messages and the questions an agent asks, not tool calls, tool output, reasoning or attachments. meta.complete is false when a page may be missing matches, usually because a common word filled the read budget (reason read_budget); narrow the search as meta.hint says.

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": {
      "workspaceSlug": "<workspaceSlug>"
    },
    "name": "session_search"
  }
}

Input Schema

NameRequiredDescriptionDefault
queryNo
workspaceSlugYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.7/5.0
Behavior5/5

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

With readOnly/destructive annotations already covering safety, the description instead discloses non-obvious behavior: index-based candidate lookup requiring word-start matches, chunked indexing of long messages that can miss spanning matches, 31-byte word truncation, smart-case and case-folding quirks, and what text is excluded from search (tool calls, tool output, reasoning, attachments). It also explains meta.complete and the read_budget reason.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with purpose and result shape, and nearly every sentence carries operational value. It is a single dense block, however, and edge cases like the Kelvin sign and İ misfires are esoteric enough that structure or trimming would aid readability.

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 two-parameter but semantically deep search tool with no output schema, the description covers return ordering, snippet shape, pagination incompleteness signaling, and the hint mechanism, which is everything an agent needs to call it and interpret results correctly.

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

Parameters5/5

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

Adds substantial meaning beyond the schema: the pattern is a JavaScript RegExp with the u flag and how that differs from ripgrep, fixedStrings forces literal matching, caseSensitive overrides smart case, and sessionId relaxes the required-word constraint by reading one session whole. Remaining parameters (from, archived, agentId, date bounds, cursor) are self-documented in the schema.

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 verb and resource: searching the messages of every visible session with a regular expression, returning sessions best-match first with matching message snippets. It also distinguishes itself from the read-in-context sibling by naming session.history.list and how to get there from a match's seq.

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 clear conditions: use this for cross-session regex search, use session.history.list to open a match in full context, use sessionId when the pattern has no indexable word, and narrow the search when meta.complete is false per meta.hint. It does not distinguish itself from memory_search or file_search siblings, so a 'when not to use this' exclusion is missing.

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.