Skip to main content
Glama
git-fabric

@git-fabric/chat

Official
by git-fabric

chat_search

Search stored conversation content using semantic matching to find relevant messages based on meaning, not just keywords. Filter results by project or specific session.

Instructions

Semantic search over all stored conversation content using vector similarity. Finds messages relevant to the query even if exact words don't match. Optionally scope to a project or specific session.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesNatural language search query.
projectNoScope search to sessions with this project tag.
limitNoMaximum number of results. Default: 10.
sessionIdNoScope search to a single session UUID.

Implementation Reference

  • The core search function that implements the chat_search tool logic. It takes a ChatAdapter, query string, and options (project, sessionId, limit), embeds the query using the adapter, and performs vector search on stored messages.
    export async function search(
      adapter: ChatAdapter,
      query: string,
      opts: {
        project?: string;
        sessionId?: string;
        limit?: number;
      },
    ): Promise<SearchResult[]> {
      const limit = opts.limit ?? 10;
    
      // Embed the query text
      const queryVector = await adapter.embed(query);
    
      // Search Qdrant
      return adapter.searchMessages(queryVector, {
        project: opts.project,
        sessionId: opts.sessionId,
        limit,
      });
    }
  • src/app.ts:239-271 (registration)
    Registration of the chat_search tool in the tools array. Defines the tool name, description, input schema (with query, project, limit, sessionId parameters), and delegates execution to layers.search.search().
    {
      name: "chat_search",
      description:
        "Semantic search over all stored conversation content using vector similarity. Finds messages relevant to the query even if exact words don't match. Optionally scope to a project or specific session.",
      inputSchema: {
        type: "object",
        properties: {
          query: {
            type: "string",
            description: "Natural language search query.",
          },
          project: {
            type: "string",
            description: "Scope search to sessions with this project tag.",
          },
          limit: {
            type: "number",
            description: "Maximum number of results. Default: 10.",
          },
          sessionId: {
            type: "string",
            description: "Scope search to a single session UUID.",
          },
        },
        required: ["query"],
      },
      execute: async (args) =>
        layers.search.search(adapter, args.query as string, {
          project: args.project as string | undefined,
          sessionId: args.sessionId as string | undefined,
          limit: args.limit as number | undefined,
        }),
    },
  • Input schema definition for the chat_search tool. Validates required 'query' parameter and optional 'project', 'limit', and 'sessionId' parameters with their types and descriptions.
    inputSchema: {
      type: "object",
      properties: {
        query: {
          type: "string",
          description: "Natural language search query.",
        },
        project: {
          type: "string",
          description: "Scope search to sessions with this project tag.",
        },
        limit: {
          type: "number",
          description: "Maximum number of results. Default: 10.",
        },
        sessionId: {
          type: "string",
          description: "Scope search to a single session UUID.",
        },
      },
      required: ["query"],
    },
  • Type definition for SearchResult output type, which extends ChatMessage with a score field for semantic search relevance ranking.
    export interface SearchResult extends ChatMessage {
      score: number;
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. While it mentions the semantic search method and optional scoping, it lacks critical details such as permission requirements, rate limits, pagination behavior, or what the output format looks like (e.g., list of messages with scores). This is a significant gap for a search tool with no annotation coverage.

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 appropriately sized and front-loaded, with the core purpose in the first sentence and optional features in the second. Every sentence earns its place by adding essential information without redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of a semantic search tool with no output schema and no annotations, the description is incomplete. It adequately explains the purpose and parameters but fails to address behavioral aspects like output format, error handling, or performance considerations, which are crucial for effective tool use.

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 documents all parameters thoroughly. The description adds marginal value by implying the optional scoping ('optionally scope to a project or specific session'), which aligns with the 'project' and 'sessionId' parameters, but doesn't provide additional syntax or format details beyond what the schema provides.

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 description clearly states the specific action ('semantic search'), resource ('all stored conversation content'), and method ('using vector similarity'). It distinguishes itself from siblings like chat_message_list (which likely lists messages without semantic search) and chat_session_get (which retrieves specific sessions rather than searching content).

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?

The description provides clear context for when to use this tool ('finds messages relevant to the query even if exact words don't match') and optional scoping parameters. However, it doesn't explicitly state when NOT to use it or name specific alternatives among the siblings, such as chat_message_list for non-semantic listing.

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/git-fabric/chat'

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