Skip to main content
Glama

search_messages

Read-onlyIdempotent

Find workspace messages by keyword, meaning, or hybrid match; narrow by channel, author, author kind, and time window. Returns ranked hits with snippets, scores, and context.

Instructions

Search the messages in a workspace by lexical, semantic or hybrid match, best hit first, optionally narrowed by channel, author, author kind and a time window. Each hit has message_id, thread_id, channel_id, author_id, posted_at, snippet, body, rank and score from 0 to 1, plus channel_name, thread_title and author_handle. Private channels and DMs the caller cannot read are never searched. Semantic and hybrid modes embed the query and count against the workspace's embedding allowance; lexical does not. To list a thread's messages in order use list_messages instead. Requires search:query.

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": {
      "workspace_id": "<workspace_id>",
      "query": "<query>"
    },
    "name": "search_messages"
  }
}

Input Schema

NameRequiredDescriptionDefault
kindNoOnly messages whose author is of this kind: human or agent.
modeNoHow to match. lexical (the default) uses full-text keyword search. semantic embeds the query and ranks by meaning. hybrid blends the two using hybrid_weight.lexical
afterNoOnly messages posted at or after this RFC 3339 instant (inclusive).
limitNoMaximum number of hits to return. Defaults to 25, from 1 to 500.
queryYesThe search text, which must not be empty. In lexical mode it is matched as keywords; in semantic and hybrid modes it is embedded and compared by meaning.
beforeNoOnly messages posted before this RFC 3339 instant (exclusive), so together with after it forms a half-open window.
author_idNoUUID of a member. Only messages written by this member are returned.
channel_idNoUUID of a channel. Only messages in this channel are returned.
snippet_onlyNoWhen true, each hit drops its full body and keeps only the snippet, to save tokens. Defaults to false.
workspace_idYesUUID of the workspace to search. It must be the caller's own workspace.
hybrid_weightNoHybrid mode only: weight given to the semantic score, from 0 to 1, defaulting to 0.5. The combined score is weight times the semantic score plus one minus weight times the lexical score, over normalized scores.
embedding_modelNoSemantic and hybrid modes only: name of the registered embedding model whose vectors to match against. Defaults to the server's active embedding provider.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed12 schema fields changedv479.0.2
    • changedInput schema / properties / after / description
      Previous value: -"Only messages posted at/after this RFC 3339 instant (inclusive)."New value: +"Only messages posted at or after this RFC 3339 instant (inclusive)."
    • addedInput schema / properties / author_id / description
      Added value: +"UUID of a member. Only messages written by this member are returned."
    • changedInput schema / properties / before / description
      Previous value: -"Only messages posted before this RFC 3339 instant (exclusive) — a half-open window with after."New value: +"Only messages posted before this RFC 3339 instant (exclusive), so together with after it forms a half-open window."
    • addedInput schema / properties / channel_id / description
      Added value: +"UUID of a channel. Only messages in this channel are returned."
    • changedInput schema / properties / embedding_model / description
      Previous value: -"Semantic/hybrid only: registered model name (default: active provider)."New value: +"Semantic and hybrid modes only: name of the registered embedding model whose vectors to match against. Defaults to the server's active embedding provider."
    • changedInput schema / properties / hybrid_weight / description
      Previous value: -"Hybrid only: semantic weight in [0,1] (default 0.5). combined = w*semantic + (1-w)*lexical over normalized scores."New value: +"Hybrid mode only: weight given to the semantic score, from 0 to 1, defaulting to 0.5. The combined score is weight times the semantic score plus one minus weight times the lexical score, over normalized scores."
    • addedInput schema / properties / kind / description
      Added value: +"Only messages whose author is of this kind: human or agent."
    • addedInput schema / properties / limit / description
      Added value: +"Maximum number of hits to return. Defaults to 25, from 1 to 500."
    • addedInput schema / properties / mode / description
      Added value: +"How to match. lexical (the default) uses full-text keyword search. semantic embeds the query and ranks by meaning. hybrid blends the two using hybrid_weight."
    • addedInput schema / properties / query / description
      Added value: +"The search text, which must not be empty. In lexical mode it is matched as keywords; in semantic and hybrid modes it is embedded and compared by meaning."
    • changedInput schema / properties / snippet_only / description
      Previous value: -"Drop full message body from each hit (keep only the snippet) to save tokens."New value: +"When true, each hit drops its full body and keeps only the snippet, to save tokens. Defaults to false."
    • addedInput schema / properties / workspace_id / description
      Added value: +"UUID of the workspace to search. It must be the caller's own workspace."
  2. First observedv479.0.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint and destructiveHint=false, so the safety profile is covered. The description still adds real behavior beyond that: private channels and DMs the caller cannot read are excluded, semantic/hybrid modes have a metered cost, and a specific scope is required. It does not mention pagination or result-count limits, which is the remaining gap.

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, modes and ordering, then cost and permission constraints, then the sibling redirect last. The enumeration of nine return fields is long but earns its place because there is no output schema.

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 12-parameter tool with no output schema, the description supplies the return shape, ranking semantics, access scoping, cost model and required scope. Nothing an agent needs to invoke it correctly is missing.

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 coverage is 100% and the schema already documents modes, bounds, formats and the hybrid_weight formula, so baseline is 3. The description adds only modestly on top: the half-open time window composition and the token-saving rationale for snippet_only, while other details largely restate 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 (search) plus resource (messages in a workspace) and enumerates the three matching modes with 'best hit first' ordering. It explicitly separates itself from list_messages, so an agent can choose between them without opening either schema.

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?

Names the alternative (list_messages) and the condition that selects it, states the required scope search:query, and warns that semantic/hybrid consume the embedding allowance while lexical does not. It stops short of stating when one mode is preferable on quality grounds, but the cost trade-off gives usable routing guidance.

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

Deploy Server

Other Tools