Skip to main content
Glama
vjsr007
by vjsr007

index-query

Query and retrieve indexed notes by specific keys or full-text search. Quickly find relevant information and organize data efficiently using advanced search capabilities.

Instructions

Query notes by key or full-text search.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keyNo
limitNo
textNo

Implementation Reference

  • Handler for 'index-query' tool: validates input with QuerySchema, retrieves notes by key using db.getByKey or performs full-text search using db.search based on parameters, limits results, and returns JSON array of matching notes.
    case 'index-query': {
      const parsed = QuerySchema.parse(args ?? {});
      let result: any[] = [];
      if (parsed.key) {
        result = db.getByKey(parsed.key, parsed.limit);
      } else if (parsed.text) {
        result = db.search(parsed.text, parsed.limit);
      }
      return { content: [{ type: 'text', text: JSON.stringify(result) }] };
    }
  • src/mcp.ts:111-121 (registration)
    Registration of the 'index-query' tool in the MCP server, defining name, description, and basic input schema.
      name: 'index-query',
      description: 'Query notes by key or full-text search.',
      inputSchema: {
        type: 'object',
        properties: {
          key: { type: 'string' },
          text: { type: 'string' },
          limit: { type: 'number' },
        },
      },
    },
  • Zod validation schema (QuerySchema) used by the index-query handler for input parsing, defining optional key/text for query, and limit up to 100 with default 10.
    export const QuerySchema = z.object({
      key: z.string().optional(),
      text: z.string().optional(),
      limit: z.number().int().positive().max(100).optional().default(10),
    });
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 of behavioral disclosure. It states the tool queries notes but doesn't describe what the query returns (e.g., note content, metadata, or IDs), any limitations (e.g., search scope or performance), or prerequisites (e.g., required index setup). This leaves significant gaps for a query tool with three parameters.

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 that front-loads the core functionality. Every word earns its place by specifying the resource (notes) and two query methods, with no redundant or vague phrasing.

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 the tool's complexity (three parameters, no annotations, no output schema), the description is incomplete. It doesn't explain the return values, how parameters interact (e.g., can 'key' and 'text' be used together?), or behavioral aspects like error handling. For a query tool with undocumented parameters, this is inadequate.

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

Parameters2/5

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

The schema description coverage is 0%, so the description must compensate. It mentions 'key' and 'text' as query parameters, which aligns with two of the three parameters, but doesn't explain their semantics (e.g., what a 'key' represents, how 'text' search works, or what 'limit' controls). This adds minimal value beyond the bare schema.

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 tool's purpose as querying notes using either key-based or full-text search. It specifies the resource (notes) and two distinct query methods, though it doesn't differentiate from sibling tools like 'index-list-keys' which might also retrieve note information.

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. The description mentions two query methods but doesn't specify scenarios for choosing between them or when to use this over sibling tools like 'index-list-keys' for listing keys or 'graph-import-from-notes' for graph-related operations.

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/vjsr007/mcp-index-notes'

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