Skip to main content
Glama

mavis_memory_search

Search stored memory entries across user, agent, or project scopes using a natural language query to retrieve relevant information.

Instructions

Search Mavis memory for entries matching a query.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scopeNoMemory scope to search
queryYesSearch query

Implementation Reference

  • src/index.js:284-296 (registration)
    The tool registration definition in the tools array. Defines name 'mavis_memory_search', input schema (optional scope enum, required query string), and buildArgs which constructs the CLI arguments as ['memory', 'search', <query>] with optional scope prepended.
    {
      name: 'mavis_memory_search',
      description: 'Search Mavis memory for entries matching a query.',
      inputSchema: z.object({
        scope: z.enum(['user', 'agent', 'project']).optional().describe('Memory scope to search'),
        query: z.string().describe('Search query')
      }),
      buildArgs: ({ scope, query }) => {
        const args = ['memory', 'search', query];
        if (scope) args.unshift(scope);
        return args;
      }
    },
  • Input schema using Zod: optional 'scope' (one of user/agent/project) and required 'query' (string) for searching Mavis memory.
    inputSchema: z.object({
      scope: z.enum(['user', 'agent', 'project']).optional().describe('Memory scope to search'),
      query: z.string().describe('Search query')
    }),
  • The generic tool handler (runTool). For 'mavis_memory_search' (no execFn, no outputMode), it calls execMavisJSON (which parses JSON output) and returns JSON-stringified result as text.
    function runTool(spec, parsedArgs) {
      const { execFn, outputMode, stdin, buildArgs } = spec;
      const args = buildArgs(parsedArgs);
      const input = typeof stdin === 'function' ? stdin(parsedArgs) : stdin;
    
      const execPromise = execFn
        ? execMavis(args, input || '')
        : execMavisJSON(args);
    
      return execPromise.then(result => {
        const text = outputMode === OUTPUT_RAW
          ? (result || '')
          : JSON.stringify(result, null, 2);
        return [{ type: 'text', text }];
      });
    }
  • Helper that executes the CLI command via execMavis and parses the output as JSON (used by mavis_memory_search since it has no execFn).
    function execMavisJSON(args) {
      return execMavis(args).then(raw => {
        try {
          return JSON.parse(raw);
        } catch {
          const jsonStart = raw.indexOf('{');
          return JSON.parse(jsonStart >= 0 ? raw.slice(jsonStart) : raw);
        }
      });
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden but only says 'search' without disclosing read-only nature, authorization requirements, result limits, or error handling behavior.

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?

Single sentence with no filler, front-loads the core function. Extremely concise.

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?

Missing output schema means description should explain return behavior (e.g., list of results, empty handling). It does not, leaving the agent with incomplete information for a simple tool.

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 coverage is 100%, so baseline is 3. The description adds no new meaning beyond the schema's parameter descriptions; it simply restates the generic searching concept.

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 resource ('Mavis memory'), using a specific verb. It distinguishes from sibling 'mavis_memory_append' by focusing on querying, but does not elaborate on scope options.

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 on when to use this tool versus alternatives like 'mavis_memory_append' or other search tools. No mention of prerequisites or typical use cases.

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/Cunning-Kang/mavis-mcp-server'

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