Skip to main content
Glama

m9k_search

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,
        },
      },

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