Skip to main content
Glama

get_issue

Retrieve details of a GitHub issue by providing owner, repository, and issue number.

Instructions

Get details of a specific issue in a GitHub repository.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ownerYesThe owner of the repository
repoYesThe name of the repository
issue_numberYesThe number of the issue

Implementation Reference

  • The handler function that fetches a specific issue from GitHub using Octokit and formats the response as markdown text.
    async ({ owner, repo, issue_number }) => {
    	try {
    		const response = await octokit.rest.issues.get({
    			owner,
    			repo,
    			issue_number,
    		})
    		const i = response.data
    		let text = `**#${i.number}: ${i.title}**\n`
    		text += `State: ${i.state}\n`
    		text += `URL: ${i.html_url}\n`
    		text += `Author: ${i.user?.login || "unknown"}\n`
    		text += `Created: ${i.created_at}\n`
    		text += `Updated: ${i.updated_at}\n`
    		if (i.assignees && i.assignees.length > 0) text += `Assignees: ${i.assignees.map(a => a.login).join(", ")}\n`
    		if (i.labels && i.labels.length > 0) text += `Labels: ${i.labels.map(l => typeof l === "string" ? l : l.name).join(", ")}\n`
    		if (i.milestone) text += `Milestone: ${i.milestone.title}\n`
    		text += `Comments: ${i.comments}\n`
    		if (i.body) text += `\n---\n${i.body}\n`
    		return {
    			content: [{ type: "text", text }],
    		}
    	} catch (e: any) {
    		return {
    			content: [{ type: "text", text: `Error: ${e.message}` }],
    		}
    	}
    },
  • Zod schema defining the input parameters for get_issue: owner (string), repo (string), issue_number (number).
    {
    	owner: z.string().describe("The owner of the repository"),
    	repo: z.string().describe("The name of the repository"),
    	issue_number: z.number().describe("The number of the issue"),
    },
  • Registration of the 'get_issue' tool on the MCP server via server.tool(), inside the registerIssueTools function.
    server.tool(
    	"get_issue",
    	"Get details of a specific issue in a GitHub repository.",
    	{
    		owner: z.string().describe("The owner of the repository"),
    		repo: z.string().describe("The name of the repository"),
    		issue_number: z.number().describe("The number of the issue"),
    	},
    	async ({ owner, repo, issue_number }) => {
    		try {
    			const response = await octokit.rest.issues.get({
    				owner,
    				repo,
    				issue_number,
    			})
    			const i = response.data
    			let text = `**#${i.number}: ${i.title}**\n`
    			text += `State: ${i.state}\n`
    			text += `URL: ${i.html_url}\n`
    			text += `Author: ${i.user?.login || "unknown"}\n`
    			text += `Created: ${i.created_at}\n`
    			text += `Updated: ${i.updated_at}\n`
    			if (i.assignees && i.assignees.length > 0) text += `Assignees: ${i.assignees.map(a => a.login).join(", ")}\n`
    			if (i.labels && i.labels.length > 0) text += `Labels: ${i.labels.map(l => typeof l === "string" ? l : l.name).join(", ")}\n`
    			if (i.milestone) text += `Milestone: ${i.milestone.title}\n`
    			text += `Comments: ${i.comments}\n`
    			if (i.body) text += `\n---\n${i.body}\n`
    			return {
    				content: [{ type: "text", text }],
    			}
    		} catch (e: any) {
    			return {
    				content: [{ type: "text", text: `Error: ${e.message}` }],
    			}
    		}
    	},
    )
  • src/index.ts:16-16 (registration)
    Top-level call that registers all issue tools (including get_issue) on the MCP server instance.
    registerIssueTools(server, octokit)
  • Helper function that encapsulates registration of all issue-related tools on the MCP server.
    export function registerIssueTools(server: McpServer, octokit: Octokit) {
Behavior2/5

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

No annotations exist, and the description does not disclose behavioral traits such as authentication requirements, rate limits, or what 'details' includes. The description is minimal and lacks context beyond the fact that it returns issue details.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentences, concise and free of unnecessary words. While it is short, it adequately conveys the core function for a simple read operation.

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 lack of output schema and annotations, the description should provide more details about the return value or behavior. It does not explain what 'details' encompasses, making it incomplete for an agent to fully utilize the tool.

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%, so the schema already documents the three parameters. The description does not add extra meaning beyond the schema, such as clarifying the format of 'issue_number' or expected constraints.

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 the action ('Get details') and resource ('issue'), and it distinguishes from sibling tools like 'list_issues' by specifying 'a specific issue'.

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?

No guidance is provided on when to use this tool vs alternatives (e.g., 'list_issues' for multiple issues, 'update_issue' for modifications). There is no mention of when not to use it.

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/hithereiamaliff/mcp-github'

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