Skip to main content
Glama
sammcj

MCP GitHub Issue Server

by sammcj

get_issue_task

Fetch and utilize GitHub issue details as tasks by providing the issue URL, enabling efficient task management and integration with GitHub’s platform.

Instructions

Fetch GitHub issue details to use as a task

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesGitHub issue URL (https://github.com/owner/repo/issues/number)

Implementation Reference

  • The MCP CallTool request handler specifically for the 'get_issue_task' tool. It validates the tool name, extracts the URL parameter, fetches issue details using getIssueDetails, formats the response as a JSON task object, and handles errors.
      this.server.setRequestHandler(CallToolRequestSchema, async (request) => {
        if (request.params.name !== "get_issue_task") {
          throw new McpError(
            ErrorCode.MethodNotFound,
            `Unknown tool: ${request.params.name}`,
          );
        }
    
        const { url } = request.params.arguments as { url: string };
        if (!url) {
          throw new McpError(
            ErrorCode.InvalidParams,
            "URL parameter is required",
          );
        }
    
        try {
          const issue = await this.getIssueDetails(url);
          return {
            content: [
              {
                type: "text",
                text: JSON.stringify(
                  {
                    task: {
                      title: issue.title,
                      description: issue.body,
                      source: issue.url,
                    },
                  },
                  null,
                  2,
                ),
              },
            ],
          };
        } catch (error) {
          if (error instanceof McpError) {
            throw error;
          }
          throw new McpError(
            ErrorCode.InternalError,
            `Unexpected error: ${error}`,
          );
        }
      });
    }
  • Helper function that parses the GitHub issue URL and fetches the issue details (title, body, URL) using the Octokit client.
    private async getIssueDetails(url: string): Promise<IssueDetails> {
      const { owner, repo, issue_number } = this.parseGitHubUrl(url);
    
      try {
        const response = await this.octokit.issues.get({
          owner,
          repo,
          issue_number,
        });
    
        return {
          title: response.data.title,
          body: response.data.body || "",
          url: response.data.html_url,
        };
      } catch (error) {
        if (error instanceof Error) {
          throw new McpError(
            ErrorCode.InternalError,
            `GitHub API error: ${error.message}`,
          );
        }
        throw error;
      }
    }
  • Helper function to parse GitHub issue URL into owner, repo, and issue number components.
    private parseGitHubUrl(url: string): {
      owner: string;
      repo: string;
      issue_number: number;
    } {
      const match = url.match(/github\.com\/([^/]+)\/([^/]+)\/issues\/(\d+)/);
      if (!match) {
        throw new McpError(
          ErrorCode.InvalidParams,
          "Invalid GitHub issue URL format. Expected: https://github.com/owner/repo/issues/number",
        );
      }
      return {
        owner: match[1],
        repo: match[2],
        issue_number: parseInt(match[3], 10),
      };
    }
  • src/index.ts:110-126 (registration)
    Tool registration in the ListTools response, including name, description, and input schema.
        {
          name: "get_issue_task",
          description: "Fetch GitHub issue details to use as a task",
          inputSchema: {
            type: "object",
            properties: {
              url: {
                type: "string",
                description:
                  "GitHub issue URL (https://github.com/owner/repo/issues/number)",
              },
            },
            required: ["url"],
          },
        },
      ],
    }));
  • Input schema definition for the get_issue_task tool, requiring a 'url' parameter.
    inputSchema: {
      type: "object",
      properties: {
        url: {
          type: "string",
          description:
            "GitHub issue URL (https://github.com/owner/repo/issues/number)",
        },
      },
      required: ["url"],
    },
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states 'Fetch' which implies a read operation, but doesn't mention any behavioral traits like rate limits, authentication needs, error handling, or what 'as a task' entails. This leaves significant gaps in understanding how the tool behaves.

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 without unnecessary words. It's front-loaded with the core action and resource, 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 tool has no annotations and no output schema, the description is incomplete. It doesn't explain what 'GitHub issue details' includes, how the data is returned, or what 'as a task' means operationally. For a tool with no structured support, more descriptive context is needed to be fully helpful.

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 the parameter 'url' fully documented in the schema. The description doesn't add any parameter-specific information beyond what the schema provides, such as format details or usage examples. With high schema coverage, the baseline score of 3 is appropriate.

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 action ('Fetch') and resource ('GitHub issue details'), making the purpose understandable. It adds context about using the fetched data 'as a task', which provides additional intent. However, with no sibling tools, it doesn't need to differentiate from alternatives, so it doesn't reach the highest 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 or any prerequisites. It mentions using the fetched details 'as a task', which hints at a potential use case but doesn't offer explicit when/when-not instructions or context for selection.

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

Related 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/sammcj/mcp-github-issue'

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