Skip to main content
Glama
zalab-inc
by zalab-inc

get_team_id

Retrieve all teams and their corresponding IDs from Linear to enable accurate team-specific operations in project management workflows.

Instructions

A tool that gets all teams and their IDs from Linear

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler implementation for the 'get_team_id' tool. It fetches teams using linearClient.teams(), processes the data, formats it using a helper function, and returns a text response with team IDs.
    export const LinearGetTeamIdTool = createSafeTool({
      name: "get_team_id",
      description: "A tool that gets all teams and their IDs from Linear",
      schema: z.object({}).shape,
      handler: async () => {
        try {
          // Get teams from Linear
          const teamsResponse = await linearClient.teams();
          
          if (!teamsResponse || !teamsResponse.nodes) {
            return {
              content: [{
                type: "text",
                text: "Could not retrieve teams from Linear. Please check your connection or permissions.",
              }],
            };
          }
          
          // Convert to TeamData format for safe processing
          const teams: TeamData[] = teamsResponse.nodes.map(team => ({
            id: team.id || "unknown-id",
            name: team.name || "Unnamed Team",
            key: team.key || "unknown-key",
            description: team.description,
            color: team.color,
            createdAt: team.createdAt,
            updatedAt: team.updatedAt,
            issueCount: team.issueCount,
            private: team.private,
            // Generate a URL if not available directly from the API
            url: `https://linear.app/team/${team.key}`
          }));
          
          // Format teams to human-readable text
          const formattedText = formatTeamsToHumanReadable(teams);
          
          // Return formatted text
          return {
            content: [{
              type: "text",
              text: formattedText,
            }],
          };
        } catch (error) {
          // Handle errors gracefully
          const errorMessage = error instanceof Error ? error.message : "Unknown error";
          return {
            content: [{
              type: "text",
              text: `An error occurred while retrieving teams:\n${errorMessage}`,
            }],
          };
        }
      }
    }); 
  • TypeScript interface defining the structure of team data used within the tool handler for type safety.
    interface TeamData {
      id: string;
      name: string;
      key: string;
      description?: string;
      color?: string;
      createdAt?: string | Date;
      updatedAt?: string | Date;
      issueCount?: number;
      private?: boolean;
      url?: string;
    }
  • Helper function that formats an array of TeamData objects into a human-readable string listing team IDs.
    function formatTeamsToHumanReadable(teams: TeamData[]): string {
      if (!teams || teams.length === 0) {
        return "No teams found in your Linear workspace.";
      }
    
      let result = "";
      
      teams.forEach((team, index) => {
        if (index > 0) {
          result += "\n";
        }
        result += `Team ID: ${team.id}`;
      });
      
      return result;
    }
  • src/index.ts:31-41 (registration)
    Registers the LinearGetTeamIdTool (and other Linear tools) with the MCP server using the registerTool utility.
    registerTool(server, [
      LinearSearchIssuesTool,
      LinearGetProfileTool,
      LinearCreateIssueTool,
      LinearCreateCommentTool,
      LinearUpdateCommentTool,
      LinearGetIssueTool,
      LinearGetTeamIdTool,
      LinearUpdateIssueTool,
      LinearGetCommentTool,
    ]);
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states the tool 'gets' data, implying a read-only operation, but doesn't disclose behavioral traits like whether it requires authentication, has rate limits, returns paginated results, or what format the output takes. For a tool with zero annotation coverage, this is a significant gap in transparency.

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 front-loads the core purpose without unnecessary words. Every part of the sentence earns its place by specifying what is retrieved, from where, and the resource type, making it highly concise and well-structured.

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 tool's simplicity (0 parameters, no output schema), the description is minimal but incomplete. It lacks details on behavioral aspects like authentication needs, output format, or error handling. Without annotations or an output schema, the description should provide more context to fully guide an AI agent, but it doesn't compensate for these gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has 0 parameters, and schema description coverage is 100%, so there's no need for parameter documentation in the description. The baseline for 0 parameters is 4, as the description appropriately doesn't waste space on non-existent parameters, though it could briefly note the lack of inputs for clarity.

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: 'gets all teams and their IDs from Linear.' It specifies the verb ('gets'), resource ('teams and their IDs'), and data source ('Linear'). However, it doesn't explicitly differentiate from sibling tools like get_profile or search_issues, which prevents a perfect score.

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. It doesn't mention prerequisites, timing, or comparisons to siblings like get_profile (which might return user-specific data) or search_issues (which might filter issues by team). This lack of contextual direction limits its utility for an AI agent.

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/zalab-inc/mcp-linear-app'

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