Skip to main content
Glama
magarcia

Linear MCP Server

linear_search_issues

Search and filter issues in Linear's issue tracking system using text queries, archived status, and result limits to find specific project items.

Instructions

Search issues in Linear with flexible filtering

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
includeArchivedNoInclude archived issues
limitNoMaximum number of issues to return (default: 10)
queryNoText to search in title/description

Implementation Reference

  • The main handler function that executes the linear_search_issues tool. It validates input, searches Linear issues using the API, extracts relevant data including state, team, assignee, and returns JSON formatted results or error.
    export const linearSearchIssuesHandler: ToolHandler = async args => {
      const params = args as {
        query: string;
        includeArchived?: boolean;
        limit?: number;
      };
    
      try {
        // Validate required parameters
        if (!params.query) {
          return {
            content: [
              {
                type: 'text',
                text: 'Error: Search query is required',
              },
            ],
            isError: true,
          };
        }
    
        // Set up search parameters
        const searchParams = {
          first: params.limit || 10,
          includeArchived: params.includeArchived || false,
          query: params.query,
        };
    
        // Search for issues using the Linear API
        const searchResult = await linearClient.issueSearch(searchParams);
    
        if (!searchResult || !searchResult.nodes) {
          return {
            content: [
              {
                type: 'text',
                text: 'Error: Failed to search issues',
              },
            ],
            isError: true,
          };
        }
    
        // Extract issue data with proper awaits
        const issues = await Promise.all(
          searchResult.nodes.map(async issue => {
            const state = issue.state ? await issue.state : null;
            const team = issue.team ? await issue.team : null;
            const assignee = issue.assignee ? await issue.assignee : null;
    
            return {
              id: await issue.id,
              identifier: await issue.identifier,
              title: await issue.title,
              description: await issue.description,
              url: await issue.url,
              state: state?.name,
              team: team?.name,
              assignee: assignee?.name,
              createdAt: await issue.createdAt,
              updatedAt: await issue.updatedAt,
            };
          })
        );
    
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify({
                pageInfo: {
                  hasNextPage: searchResult.pageInfo.hasNextPage,
                  endCursor: searchResult.pageInfo.endCursor,
                },
                issues,
              }),
            },
          ],
        };
      } catch (error) {
        const errorMessage =
          error instanceof Error
            ? error.message
            : typeof error === 'string'
              ? error
              : 'Unknown error occurred';
    
        return {
          content: [
            {
              type: 'text',
              text: `Error: ${errorMessage}`,
            },
          ],
          isError: true,
        };
      }
    };
  • Input schema defining the parameters for the linear_search_issues tool: query (string), includeArchived (boolean), limit (number).
    inputSchema: {
      type: 'object',
      properties: {
        query: {
          type: 'string',
          description: 'Text to search in title/description',
        },
        includeArchived: {
          type: 'boolean',
          description: 'Include archived issues',
        },
        limit: {
          type: 'number',
          description: 'Maximum number of issues to return (default: 10)',
        },
      },
    },
  • Registration of the linear_search_issues tool using registerTool, specifying name, description, inputSchema, and linking to the handler.
    export const linearSearchIssuesTool = registerTool(
      {
        name: 'linear_search_issues',
        description: 'Search issues in Linear with flexible filtering',
        inputSchema: {
          type: 'object',
          properties: {
            query: {
              type: 'string',
              description: 'Text to search in title/description',
            },
            includeArchived: {
              type: 'boolean',
              description: 'Include archived issues',
            },
            limit: {
              type: 'number',
              description: 'Maximum number of issues to return (default: 10)',
            },
          },
        },
      },
      linearSearchIssuesHandler
    );
  • src/tools/index.ts:4-4 (registration)
    Import statement in index.ts that loads and registers the linear_search_issues tool by importing it.
    import './linear_search_issues.js';
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 mentions 'flexible filtering' but doesn't explain what that entails—whether it supports complex queries, pagination, sorting, or error handling. For a search tool with zero annotation coverage, this leaves significant gaps in understanding how the tool behaves beyond basic functionality.

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 directly states the tool's purpose. There's no wasted verbiage or redundancy. It's appropriately sized and front-loaded, making it easy to grasp immediately.

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 complexity of a search tool with no annotations and no output schema, the description is insufficient. It doesn't explain return values, error conditions, or the scope of 'flexible filtering'. For a tool that likely returns structured data, more context is needed to help an agent use it effectively.

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 all parameters are documented in the schema. The description adds no additional information about parameters beyond what's in the schema (e.g., it doesn't clarify 'flexible filtering' in relation to the 'query' parameter). This meets the baseline for high schema coverage but doesn't enhance parameter understanding.

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 verb ('Search') and resource ('issues in Linear'), making the purpose immediately understandable. However, it doesn't differentiate this tool from sibling tools like 'linear_get_team_issues' or 'linear_get_project_issues', which appear to be more specific search variants. The term 'flexible filtering' is somewhat vague but still conveys the core functionality.

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 like 'linear_get_team_issues' or 'linear_get_project_issues'. It doesn't mention prerequisites, limitations, or typical use cases. The phrase 'flexible filtering' implies broad applicability but offers no concrete usage context.

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/magarcia/mcp-server-linearapp'

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