Skip to main content
Glama

tracker_search

Read-onlyIdempotent

Search by keyword across projects, epics, tasks, and notes. Results are categorized by entity type, with optional filtering by git branch and specific entity types.

Instructions

Search across ALL entities (projects, epics, tasks, notes) by keyword. Returns categorized results. Pass branch="current" to restrict epic/task matches to the active git branch (projects and notes are not branch-scoped).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch keywords
entity_typesNoLimit search to specific entity types (omit for all)
branchNoFilter epic/task results by git branch. Pass "current" to auto-detect; pass empty string to restrict to branch-agnostic epics. Omit to include all.
limitNoMax results per entity type

Implementation Reference

  • Handler function for tracker_search tool. Accepts query, entity_types, branch, and limit arguments. Searches across projects, epics (with optional branch filter via JOIN on projects), tasks (with branch filter via JOIN on epics), and notes using LIKE patterns.
    function handleSearch(args: Record<string, unknown>) {
      const db = getDb();
      const query = args.query as string;
      const entityTypes = (args.entity_types as string[] | undefined) ?? ['project', 'epic', 'task', 'note'];
      const limit = (args.limit as number) ?? 20;
      const pattern = `%${query}%`;
      const branchFilter = resolveBranch(args.branch);
    
      let epicBranchClause = '';
      let taskBranchClause = '';
      const epicBranchParams: unknown[] = [];
      const taskBranchParams: unknown[] = [];
      if (branchFilter === null) {
        epicBranchClause = ' AND e.branch IS NULL';
        taskBranchClause = ' AND e.branch IS NULL';
      } else if (branchFilter !== undefined) {
        epicBranchClause = ' AND e.branch = ?';
        taskBranchClause = ' AND e.branch = ?';
        epicBranchParams.push(branchFilter);
        taskBranchParams.push(branchFilter);
      }
    
      const results: Record<string, unknown[]> = {};
    
      if (entityTypes.includes('project')) {
        results.projects = db
          .prepare('SELECT * FROM projects WHERE name LIKE ? OR description LIKE ? LIMIT ?')
          .all(pattern, pattern, limit);
      }
    
      if (entityTypes.includes('epic')) {
        results.epics = db
          .prepare(
            `SELECT e.*, p.name as project_name
             FROM epics e
             JOIN projects p ON p.id = e.project_id
             WHERE (e.name LIKE ? OR e.description LIKE ?)${epicBranchClause}
             LIMIT ?`
          )
          .all(pattern, pattern, ...epicBranchParams, limit);
      }
    
      if (entityTypes.includes('task')) {
        results.tasks = db
          .prepare(
            `SELECT t.*, e.name as epic_name
             FROM tasks t
             JOIN epics e ON e.id = t.epic_id
             WHERE (t.title LIKE ? OR t.description LIKE ?)${taskBranchClause}
             LIMIT ?`
          )
          .all(pattern, pattern, ...taskBranchParams, limit);
      }
    
      if (entityTypes.includes('note')) {
        results.notes = db
          .prepare('SELECT * FROM notes WHERE title LIKE ? OR content LIKE ? LIMIT ?')
          .all(pattern, pattern, limit);
      }
    
      return results;
    }
  • Tool definition with input schema for tracker_search. Declares the tool name, description, annotations (readOnly, idempotent), and input schema with query (required string), entity_types (optional array of project/epic/task/note), branch (optional string), and limit (optional integer, default 20).
    {
      name: 'tracker_search',
      description:
        'Search across ALL entities (projects, epics, tasks, notes) by keyword. Returns categorized results. Pass branch="current" to restrict epic/task matches to the active git branch (projects and notes are not branch-scoped).',
      annotations: { title: 'Global Search', readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
      inputSchema: {
        type: 'object',
        properties: {
          query: { type: 'string', description: 'Search keywords' },
          entity_types: {
            type: 'array',
            items: { type: 'string', enum: ['project', 'epic', 'task', 'note'] },
            description: 'Limit search to specific entity types (omit for all)',
          },
          branch: {
            type: 'string',
            description: 'Filter epic/task results by git branch. Pass "current" to auto-detect; pass empty string to restrict to branch-agnostic epics. Omit to include all.',
          },
          limit: { type: 'integer', default: 20, description: 'Max results per entity type' },
        },
        required: ['query'],
      },
    },
  • src/index.ts:37-49 (registration)
    Registration of the tracker_search handler in the main server index. searchHandlers (exported from search.ts) is spread into ALL_HANDLERS, which is used by the CallToolRequestSchema handler to dispatch tool calls.
    const ALL_HANDLERS: Record<string, (args: Record<string, unknown>) => unknown> = {
      ...projectHandlers,
      ...epicHandlers,
      ...taskHandlers,
      ...subtaskHandlers,
      ...noteHandlers,
      ...commentHandlers,
      ...templateHandlers,
      ...dashboardHandlers,
      ...searchHandlers,
      ...activityHandlers,
      ...exportImportHandlers,
    };
  • Helper function resolveBranch used by tracker_search to process the 'branch' argument. Returns undefined if omitted, null if empty string (restrict to branch-agnostic), the result of getCurrentBranch() if 'current', or the literal branch string otherwise.
    export function resolveBranch(input: unknown): string | null | undefined {
      if (input === undefined) return undefined;
      if (input === null || input === '') return null;
      if (typeof input !== 'string') return undefined;
      if (input === 'current') return getCurrentBranch();
      return input;
    }
  • Type definition for ToolHandler used by the handlers export in search.ts.
    export type ToolHandler = (args: Record<string, unknown>) => unknown;
Behavior3/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, idempotentHint=true, covering safety. The description adds behavioral context about branch scoping but does not detail pagination, rate limits, or result structure. With good annotations, this is adequate but not enriched.

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 two sentences, no fluff. First sentence states purpose and result; second provides a key usage tip. Front-loaded and efficient.

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

Completeness3/5

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

The description covers the main search behavior and branch parameter but omits mention of the limit and entity_types parameters (though schema covers them). No output schema exists, so the description could better explain the 'categorized results' format. Adequate but not thorough.

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% with detailed parameter descriptions. The description adds a concise usage tip for the branch parameter, providing marginal added meaning. For high-coverage schemas, baseline is 3, and the extra is minimal.

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?

The description clearly states 'Search across ALL entities (projects, epics, tasks, notes) by keyword. Returns categorized results.' It specifies the verb (search), resource (all entities), and output (categorized), distinguishing it from sibling tools like note_search or epic_list.

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?

The description provides explicit guidance for the branch parameter ('Pass branch="current" to restrict...') but does not compare to sibling tools for entity-specific searches. It implies when to use branch filtering but lacks when-not-to-use guidance relative to alternatives.

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/spranab/saga-mcp'

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