Skip to main content
Glama

create_issue

Create a new GitHub issue with a title, description, assignees, labels, and milestone to track tasks or report problems.

Instructions

Create a new issue in a GitHub repository.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ownerYesRepository owner
repoYesRepository name
titleYesIssue title
bodyNoIssue body content
assigneesNoUsernames to assign to this issue
labelsNoLabels to apply to this issue
milestoneNoMilestone number

Implementation Reference

  • The async handler function that executes the 'create_issue' tool logic. It calls octokit.rest.issues.create() with the provided parameters (owner, repo, title, body, assignees, labels, milestone) and returns a formatted text response with the created issue details.
    async ({ owner, repo, title, body, assignees, labels, milestone }) => {
    	try {
    		const response = await octokit.rest.issues.create({
    			owner,
    			repo,
    			title,
    			body,
    			assignees,
    			labels,
    			milestone,
    		})
    		const i = response.data
    		let text = `Issue created: **#${i.number}: ${i.title}**\n`
    		text += `URL: ${i.html_url}\n`
    		text += `State: ${i.state}\n`
    		if (i.labels && i.labels.length > 0) text += `Labels: ${i.labels.map(l => typeof l === "string" ? l : l.name).join(", ")}\n`
    		if (i.assignees && i.assignees.length > 0) text += `Assignees: ${i.assignees.map(a => a.login).join(", ")}\n`
    		return {
    			content: [{ type: "text", text }],
    		}
    	} catch (e: any) {
    		return {
    			content: [{ type: "text", text: `Error: ${e.message}` }],
    		}
    	}
    },
  • Zod schema definitions for the 'create_issue' tool inputs: owner (string), repo (string), title (string), body (optional string), assignees (optional array of strings), labels (optional array of strings), milestone (optional number).
    {
    	owner: z.string().describe("Repository owner"),
    	repo: z.string().describe("Repository name"),
    	title: z.string().describe("Issue title"),
    	body: z.string().optional().describe("Issue body content"),
    	assignees: z
    		.array(z.string())
    		.optional()
    		.describe("Usernames to assign to this issue"),
    	labels: z
    		.array(z.string())
    		.optional()
    		.describe("Labels to apply to this issue"),
    	milestone: z.number().optional().describe("Milestone number"),
    },
  • The registration of the 'create_issue' tool via server.tool(), including the name 'create_issue', description 'Create a new issue in a GitHub repository.', the Zod schema, and the handler function.
    // Tool: Create Issue
    server.tool(
    	"create_issue",
    	"Create a new issue in a GitHub repository.",
    	{
    		owner: z.string().describe("Repository owner"),
    		repo: z.string().describe("Repository name"),
    		title: z.string().describe("Issue title"),
    		body: z.string().optional().describe("Issue body content"),
    		assignees: z
    			.array(z.string())
    			.optional()
    			.describe("Usernames to assign to this issue"),
    		labels: z
    			.array(z.string())
    			.optional()
    			.describe("Labels to apply to this issue"),
    		milestone: z.number().optional().describe("Milestone number"),
    	},
    	async ({ owner, repo, title, body, assignees, labels, milestone }) => {
    		try {
    			const response = await octokit.rest.issues.create({
    				owner,
    				repo,
    				title,
    				body,
    				assignees,
    				labels,
    				milestone,
    			})
    			const i = response.data
    			let text = `Issue created: **#${i.number}: ${i.title}**\n`
    			text += `URL: ${i.html_url}\n`
    			text += `State: ${i.state}\n`
    			if (i.labels && i.labels.length > 0) text += `Labels: ${i.labels.map(l => typeof l === "string" ? l : l.name).join(", ")}\n`
    			if (i.assignees && i.assignees.length > 0) text += `Assignees: ${i.assignees.map(a => a.login).join(", ")}\n`
    			return {
    				content: [{ type: "text", text }],
    			}
    		} catch (e: any) {
    			return {
    				content: [{ type: "text", text: `Error: ${e.message}` }],
    			}
    		}
    	},
    )
  • src/index.ts:4-4 (registration)
    Import of the registerIssueTools function from the tools/issues module.
    import { registerIssueTools } from "./tools/issues.js"
  • src/index.ts:16-16 (registration)
    Call to registerIssueTools(server, octokit) which registers all issue tools including create_issue on the MCP server.
    registerIssueTools(server, octokit)
Behavior2/5

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

No annotations provided, and the description omits behavioral details such as side effects, return value, or required permissions. Minimal information for a creation tool.

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 sentence, efficient and to the point. However, it could include more detail without becoming overly verbose.

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 no output schema and no annotations, the description lacks details about return value, error handling, or usage constraints. Incomplete for a tool with 7 parameters.

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 baseline is 3. The description adds no additional meaning beyond the schema, which already documents all parameters.

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 'Create a new issue in a GitHub repository' clearly states the action (create) and resource (issue), distinguishing it from siblings like update_issue or list_issues.

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 on when to use this tool versus alternatives like update_issue or add_issue_comment. Missing prerequisites or 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/hithereiamaliff/mcp-github'

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