Skip to main content
Glama

holistic_search

Search across all memory layers—content, decisions, mistakes, concepts, sessions, and commits—to find relevant information in writing projects.

Instructions

Unified search across all memory layers (content, decisions, mistakes, concepts, sessions, commits)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_pathNoPath to manuscript directory (defaults to current directory)
queryYesSearch query
layersNoMemory layers to search (default: all)
start_dateNoFilter results after this date (ISO format or relative)
end_dateNoFilter results before this date (ISO format or relative)
limitNoMaximum results to return
min_relevanceNoMinimum relevance score (0-1)

Implementation Reference

  • Tool registration definition including name, description, and input schema for 'holistic_search' in the writerToolDefinitions array.
    {
      name: "holistic_search",
      description: "Unified search across all memory layers (content, decisions, mistakes, concepts, sessions, commits)",
      inputSchema: {
        type: "object",
        properties: {
          project_path: { type: "string", description: "Path to manuscript directory (defaults to current directory)" },
          query: { type: "string", description: "Search query" },
          layers: {
            type: "array",
            items: {
              type: "string",
              enum: ["content", "decisions", "mistakes", "concepts", "sessions", "commits"],
            },
            description: "Memory layers to search (default: all)",
          },
          start_date: { type: "string", description: "Filter results after this date (ISO format or relative)" },
          end_date: { type: "string", description: "Filter results before this date (ISO format or relative)" },
          limit: { type: "number", description: "Maximum results to return", default: 20 },
          min_relevance: { type: "number", description: "Minimum relevance score (0-1)", default: 0 },
        },
        required: ["query"],
      },
    },
  • Input schema defining parameters for the holistic_search tool: query (required), layers, dates, limit, min_relevance.
    inputSchema: {
      type: "object",
      properties: {
        project_path: { type: "string", description: "Path to manuscript directory (defaults to current directory)" },
        query: { type: "string", description: "Search query" },
        layers: {
          type: "array",
          items: {
            type: "string",
            enum: ["content", "decisions", "mistakes", "concepts", "sessions", "commits"],
          },
          description: "Memory layers to search (default: all)",
        },
        start_date: { type: "string", description: "Filter results after this date (ISO format or relative)" },
        end_date: { type: "string", description: "Filter results before this date (ISO format or relative)" },
        limit: { type: "number", description: "Maximum results to return", default: 20 },
        min_relevance: { type: "number", description: "Minimum relevance score (0-1)", default: 0 },
      },
      required: ["query"],
  • Handler method in WritersAid class that receives tool parameters, processes dates, and delegates execution to HolisticSearcher.search method.
    async holisticSearch(options: {
      query: string;
      layers?: Array<"content" | "decisions" | "mistakes" | "concepts" | "sessions" | "commits">;
      startDate?: string;
      endDate?: string;
      limit?: number;
      minRelevance?: number;
    }) {
      const dateRange = {
        start: options.startDate ? new Date(options.startDate) : undefined,
        end: options.endDate ? new Date(options.endDate) : undefined,
      };
    
      return this.holisticSearcher.search({
        query: options.query,
        layers: options.layers,
        dateRange,
        limit: options.limit,
        minRelevance: options.minRelevance,
      });
    }
  • Core implementation of unified search in HolisticSearcher class: searches specified layers in parallel, merges results, sorts by relevance, applies filters and limit.
    async search(query: HolisticSearchQuery): Promise<HolisticSearchResult> {
      const startTime = Date.now();
      const layers = query.layers || [
        "content",
        "decisions",
        "mistakes",
        "concepts",
        "sessions",
        "commits",
      ];
      const limit = query.limit || 20;
    
      const allResults: SearchResult[] = [];
      const layerStats: Record<SearchLayer, number> = {
        content: 0,
        decisions: 0,
        mistakes: 0,
        concepts: 0,
        sessions: 0,
        commits: 0,
      };
    
      // Search each layer in parallel
      const promises = [];
    
      if (layers.includes("content")) {
        promises.push(this.searchContent(query));
      }
    
      if (layers.includes("decisions")) {
        promises.push(this.searchDecisions(query));
      }
    
      if (layers.includes("mistakes")) {
        promises.push(this.searchMistakes(query));
      }
    
      if (layers.includes("concepts")) {
        promises.push(this.searchConcepts(query));
      }
    
      if (layers.includes("sessions")) {
        promises.push(this.searchSessions(query));
      }
    
      if (layers.includes("commits")) {
        promises.push(this.searchCommits(query));
      }
    
      const results = await Promise.all(promises);
    
      // Merge and sort results by relevance
      for (const layerResults of results) {
        for (const result of layerResults) {
          allResults.push(result);
          layerStats[result.layer]++;
        }
      }
    
      // Sort by relevance (highest first)
      allResults.sort((a, b) => b.relevance - a.relevance);
    
      // Apply minimum relevance filter
      const minRelevance = query.minRelevance || 0;
      const filtered = allResults.filter((r) => r.relevance >= minRelevance);
    
      // Apply limit
      const limited = filtered.slice(0, limit);
    
      const executionTime = Date.now() - startTime;
    
      return {
        query: query.query,
        results: limited,
        totalResults: filtered.length,
        layerStats,
        searchedLayers: layers,
        executionTime,
      };
    }
  • HolisticSearcher class definition and constructor that initializes dependencies for multi-layer search.
    export class HolisticSearcher {
      private db: SQLiteManager;
      private manuscriptSearch: ManuscriptSearch;
      private sessionManager: SessionManager;
      private conceptTracker: ConceptTracker;
    
      constructor(
        db: SQLiteManager,
        manuscriptSearch: ManuscriptSearch,
        sessionManager: SessionManager,
        _decisionExtractor: DecisionExtractor,
        _mistakeTracker: MistakeTracker,
        conceptTracker: ConceptTracker,
        _gitIntegrator: GitIntegrator
      ) {
        this.db = db;
        this.manuscriptSearch = manuscriptSearch;
        this.sessionManager = sessionManager;
        this.conceptTracker = conceptTracker;
      }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure but provides minimal information. It mentions 'unified search' but doesn't describe what the search returns, how results are ranked, whether it's read-only or has side effects, or any performance considerations. The description is too brief to adequately inform agent 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?

The description is extremely concise - a single sentence that efficiently communicates the core functionality. It's front-loaded with the main purpose and includes the complete list of searchable layers. Every word serves a purpose with zero waste.

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?

For a complex search tool with 7 parameters, no annotations, and no output schema, the description is insufficient. It doesn't explain what the search returns, how results are formatted, whether there are limitations or constraints, or how this differs from sibling search tools. The description leaves too many behavioral questions unanswered.

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%, so the schema already documents all 7 parameters thoroughly. The description adds no parameter-specific information beyond what's in the schema. The baseline score of 3 reflects adequate parameter documentation entirely through the 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 'Unified search across all memory layers' with specific layers enumerated (content, decisions, mistakes, concepts, sessions, commits). It uses a specific verb ('search') and resource ('memory layers'), but doesn't explicitly differentiate from sibling tools like 'search_content' or 'search_similar_mistakes'.

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?

The description provides no guidance on when to use this tool versus alternatives. With multiple search-related sibling tools (search_content, search_similar_mistakes, find_related_sections, etc.), there's no indication of when this unified search is preferred over more specific search tools.

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/xiaolai/claude-writers-aid-mcp'

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