Skip to main content
Glama
QuixiAI

AGI MCP Server

by QuixiAI

search_memories_text

Find stored memories by searching text content with full-text queries to retrieve relevant information from persistent memory systems.

Instructions

Search memories by text content using full-text search

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesText query to search for
limitNoMaximum number of results

Implementation Reference

  • The core handler function searchMemoriesByText that executes full-text search on active memories using PostgreSQL tsquery and ts_rank, returning relevant memories ordered by rank and relevance.
    async searchMemoriesByText(query, limit = 10) {
      try {
        const results = await this.db
          .select({
            id: schema.memories.id,
            type: schema.memories.type,
            content: schema.memories.content,
            importance: schema.memories.importance,
            accessCount: schema.memories.accessCount,
            createdAt: schema.memories.createdAt,
            relevanceScore: schema.memories.relevanceScore,
            textRank: sql`ts_rank(to_tsvector('english', ${schema.memories.content}), plainto_tsquery('english', ${query}))`.as('text_rank')
          })
          .from(schema.memories)
          .where(
            and(
              eq(schema.memories.status, 'active'),
              sql`to_tsvector('english', ${schema.memories.content}) @@ plainto_tsquery('english', ${query})`
            )
          )
          .orderBy(
            sql`ts_rank(to_tsvector('english', ${schema.memories.content}), plainto_tsquery('english', ${query})) DESC`,
            desc(schema.memories.relevanceScore)
          )
          .limit(limit);
    
        return results;
      } catch (error) {
        console.error('Error searching memories by text:', error);
        throw error;
      }
    }
  • Input schema definition for the search_memories_text tool, specifying query string and optional limit.
    {
      name: "search_memories_text",
      description: "Search memories by text content using full-text search",
      inputSchema: {
        type: "object",
        properties: {
          query: {
            type: "string",
            description: "Text query to search for"
          },
          limit: {
            type: "integer",
            description: "Maximum number of results",
            default: 10
          }
        },
        required: ["query"]
      }
    },
  • mcp.js:554-559 (registration)
    Registration and dispatching in the MCP tool call handler: switch case that invokes the memoryManager's searchMemoriesByText method and formats the response.
    case "search_memories_text":
      const textResults = await memoryManager.searchMemoriesByText(
        args.query,
        args.limit || 10
      );
      return { content: [{ type: "text", text: JSON.stringify(textResults, null, 2) }] };
  • mcp.js:88-104 (schema)
    Tool schema exposed in the MCP ListTools handler for client discovery.
    name: "search_memories_text",
    description: "Search memories by text content using full-text search",
    inputSchema: {
      type: "object",
      properties: {
        query: {
          type: "string",
          description: "Text query to search for"
        },
        limit: {
          type: "integer",
          description: "Maximum number of results",
          default: 10
        }
      },
      required: ["query"]
    }
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states the search method ('full-text search') but lacks details on permissions, rate limits, result format, pagination, or error handling. For a search tool with zero annotation coverage, this is a significant gap in behavioral disclosure.

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 a single, efficient sentence with zero waste. It is appropriately sized and front-loaded, clearly stating the tool's purpose without unnecessary elaboration.

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

Completeness2/5

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

Given no annotations and no output schema, the description is incomplete. It lacks details on behavioral traits, return values, and usage context, which are essential for a search tool. The high schema coverage does not compensate for these missing elements.

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%, with both parameters ('query' and 'limit') well-documented in the schema. The description adds no additional parameter semantics beyond implying text-based search, so it meets the baseline of 3 without compensating for any schema gaps.

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?

The description clearly states the action ('search') and target resource ('memories by text content'), specifying the method ('full-text search'). It distinguishes from some siblings like 'get_memory' (retrieval) and 'find_related_memories' (relation-based), though not explicitly from 'search_memories_advanced' or 'search_memories_similarity'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

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

No guidance is provided on when to use this tool versus alternatives. It does not mention when to prefer it over 'search_memories_advanced' or 'search_memories_similarity', nor does it specify prerequisites or exclusions, leaving usage context unclear.

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/QuixiAI/agi-mcp-server'

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