Skip to main content
Glama

m9k_search

Read-onlyIdempotent

Search indexed conversations and files with hybrid search to find relevant past information. Returns compact results with snippets, boosting current project and session content by default.

Instructions

Search indexed past conversations. Returns compact results with snippets. Results from the current project and session are boosted by default. Use m9k_context or m9k_full to drill down.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query (keywords or natural language)
projectNoFilter by project path. Omit for cross-project search.
limitNoMax results
sinceNoISO-8601 date. Only results after this date.
untilNoISO-8601 date. Only results before this date (exclusive).
orderNoSort order: score (relevance), date_asc (oldest first), date_desc (newest first)score
sourceNoFilter by source type. Default: all sources.

Implementation Reference

  • The async handler function for 'm9k_search' that calls the underlying search utility.
    async ({ query, project, limit, since, until, order }) => {
      const currentSession = getStat(ctx.db, 'current_session_id') || undefined;
      const results = await search(
        ctx.db,
        {
          query,
          project,
          currentProject: ctx.currentProject,
          currentSession,
          limit,
          since,
          until,
          order,
        },
        ctx.searchContext,
      );
      return {
        content: [{ type: 'text' as const, text: JSON.stringify(results) }],
      };
    },
  • Registration and schema definition for 'm9k_search' tool.
    server.registerTool(
      'm9k_search',
      {
        description:
          'Search indexed past conversations. Returns compact results with snippets. Results from the current project and session are boosted by default. Use m9k_context or m9k_full to drill down.',
        inputSchema: {
          query: z.string().describe('Search query (keywords or natural language)'),
          project: z
            .string()
            .optional()
            .describe('Filter by project path. Omit for cross-project search.'),
          limit: z.number().int().min(1).max(50).default(10).describe('Max results'),
          since: z.string().optional().describe('ISO-8601 date. Only results after this date.'),
          until: z
            .string()
            .optional()
            .describe('ISO-8601 date. Only results before this date (exclusive).'),
          order: z
            .enum(['score', 'date_asc', 'date_desc'])
            .default('score')
            .describe(
              'Sort order: score (relevance), date_asc (oldest first), date_desc (newest first)',
            ),
          source: z
            .enum(['conversations', 'git', 'files'])
            .optional()
            .describe('Filter by source type. Default: all sources.'),
        },
        annotations: {
          readOnlyHint: true,
          destructiveHint: false,
          idempotentHint: true,
          openWorldHint: false,
        },
      },
Behavior4/5

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

Annotations declare readOnly/idempotent/destructive hints. Description adds valuable behavioral context beyond annotations: return format ('compact results with snippets') and default ranking behavior ('current project and session are boosted by default'). No contradictions with annotations.

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?

Four sentences with zero waste: core purpose, output format, default behavior, and alternative tools. Each sentence earns its place and information is front-loaded appropriately.

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

Completeness4/5

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

No output schema exists, but description partially compensates by characterizing the return value ('compact results with snippets'). Given the 100% schema coverage and clear annotations, the description provides sufficient context for a search tool, though it could briefly mention the indexing scope.

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%, providing full parameter documentation. Description adds semantic context for 'project' parameter by mentioning current project boosting, but does not elaborate on other parameters (dates, order, source) beyond schema definitions, warranting baseline score.

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 specific verb (Search) + resource (indexed past conversations) and distinguishes from siblings by explicitly mentioning m9k_context and m9k_full as tools for drilling down, establishing this tool's role in the discovery workflow.

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?

Provides explicit alternative tools (m9k_context or m9k_full) for drilling down, implying this tool is for initial discovery. Lacks explicit 'when-not' exclusions (e.g., don't use for detailed analysis), but the alternative guidance is clear.

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/louis49/melchizedek'

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