Skip to main content
Glama
magarcia

Linear MCP Server

linear_get_user_issues

Retrieve issues assigned to a specific user from Linear's issue tracking system, including options to filter archived items and set result limits.

Instructions

Get issues assigned to a user

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
includeArchivedNoInclude archived issues
limitNoMaximum number of issues to return (default: 50)
userIdNoUser ID (omit for authenticated user)

Implementation Reference

  • The main handler function that executes the tool logic: fetches user's assigned issues from Linear (by userId or viewer), processes issue details (state, team), returns JSON with user data, pagination info, and issue list. Handles errors gracefully.
    export const linearGetUserIssuesHandler: ToolHandler = async args => {
      const params = args as {
        userId?: string;
        includeArchived?: boolean;
        limit?: number;
      };
    
      try {
        const limit = params.limit || 50;
        const includeArchived = params.includeArchived || false;
        let user;
    
        // If userId is provided, get that user, otherwise get the current authenticated user
        if (params.userId) {
          user = await linearClient.user(params.userId);
          if (!user) {
            return {
              content: [
                {
                  type: 'text',
                  text: `Error: User with ID ${params.userId} not found`,
                },
              ],
              isError: true,
            };
          }
        } else {
          user = await linearClient.viewer;
        }
    
        // Get assigned issues for the user
        const assignedIssues = await user.assignedIssues({
          first: limit,
          includeArchived,
        });
    
        if (!assignedIssues || !assignedIssues.nodes) {
          return {
            content: [
              {
                type: 'text',
                text: "Error: Failed to fetch user's issues",
              },
            ],
            isError: true,
          };
        }
    
        // Process the results
        const issues = await Promise.all(
          assignedIssues.nodes.map(async issue => {
            const state = await issue.state;
            const team = await issue.team;
    
            return {
              id: await issue.id,
              number: await issue.number,
              title: await issue.title,
              url: await issue.url,
              priority: await issue.priority,
              state: state ? await state.name : null,
              teamName: team ? await team.name : null,
              createdAt: await issue.createdAt,
            };
          })
        );
    
        const userData = {
          id: await user.id,
          name: await user.name,
          displayName: await user.displayName,
        };
    
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify({
                user: userData,
                pageInfo: {
                  hasNextPage: assignedIssues.pageInfo.hasNextPage,
                  endCursor: assignedIssues.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 optional parameters: userId (string), includeArchived (boolean), limit (number).
    inputSchema: {
      type: 'object',
      properties: {
        userId: {
          type: 'string',
          description: 'User ID (omit for authenticated user)',
        },
        includeArchived: {
          type: 'boolean',
          description: 'Include archived issues',
        },
        limit: {
          type: 'number',
          description: 'Maximum number of issues to return (default: 50)',
        },
      },
    },
  • Local registration of the tool using registerTool, specifying name, description, inputSchema, and linking to the handler.
    export const linearGetUserIssuesTool = registerTool(
      {
        name: 'linear_get_user_issues',
        description: 'Get issues assigned to a user',
        inputSchema: {
          type: 'object',
          properties: {
            userId: {
              type: 'string',
              description: 'User ID (omit for authenticated user)',
            },
            includeArchived: {
              type: 'boolean',
              description: 'Include archived issues',
            },
            limit: {
              type: 'number',
              description: 'Maximum number of issues to return (default: 50)',
            },
          },
        },
      },
      linearGetUserIssuesHandler
    );
  • src/tools/index.ts:5-5 (registration)
    Global registration via import in index.ts, which side-effect registers all tools by importing their registration modules.
    import './linear_get_user_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 'Get issues' but does not specify if this is a read-only operation, what permissions are needed, how pagination works (implied by 'limit' but not explained), or error handling. This is a significant gap for a tool with parameters and no output schema.

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 with no wasted words. It is front-loaded and directly states the tool's purpose, making it easy to parse quickly.

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 fetching user issues with parameters and no output schema, the description is incomplete. It lacks details on return format, error cases, authentication needs, and how it differs from sibling tools, making it inadequate for full contextual understanding.

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?

The schema description coverage is 100%, with clear descriptions for all parameters in the input schema. The description does not add any extra meaning beyond the schema, such as explaining parameter interactions or default behaviors, so it meets the baseline for high coverage without compensation.

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 'Get' and the resource 'issues assigned to a user', which is specific and actionable. However, it does not explicitly differentiate from sibling tools like 'linear_get_project_issues' or 'linear_get_team_issues', which also retrieve issues but with different scopes, so it lacks sibling distinction.

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 such as 'linear_search_issues' or other issue-fetching siblings. It lacks context on prerequisites, exclusions, or comparisons, leaving the agent to infer usage based on the name alone.

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