create_issue
Create GitHub issues to track bugs, features, or tasks in repositories. Specify repository owner, name, title, and optional description to add new issues.
Instructions
Create an issue in a repository
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| owner | Yes | ||
| repo | Yes | ||
| title | Yes | ||
| body | No |
Implementation Reference
- src/apis/github/github.ts:106-114 (handler)The main handler function for the 'create_issue' tool. It validates the input arguments (owner, repo, title, optional body), checks for GitHub token configuration, and delegates to the GitHubClient's createIssue method to POST a new issue.async create_issue(args: Record<string, unknown>) { if (!cfg.githubToken) throw new Error("GITHUB_TOKEN is not configured"); const owner = String(args.owner || ""); const repo = String(args.repo || ""); const title = String(args.title || ""); const body = args.body ? String(args.body) : undefined; if (!owner || !repo || !title) throw new Error("owner, repo and title are required"); return client.createIssue(owner, repo, title, body); },
- src/apis/github/github.ts:67-76 (schema)The input schema definition for the 'create_issue' tool, specifying properties for owner, repo, title (required), and optional body as strings.inputSchema: { type: "object", properties: { owner: { type: "string" }, repo: { type: "string" }, title: { type: "string" }, body: { type: "string" }, }, required: ["owner", "repo", "title"], },
- src/apis/github/github.ts:64-77 (registration)The tool registration entry in the tools array of registerGitHub(), including name, description, and input schema.{ name: "create_issue", description: "Create an issue in a repository", inputSchema: { type: "object", properties: { owner: { type: "string" }, repo: { type: "string" }, title: { type: "string" }, body: { type: "string" }, }, required: ["owner", "repo", "title"], }, },
- src/apis/github/github.ts:22-27 (helper)Helper method in GitHubClient class that makes the actual API request to create an issue using POST to /repos/{owner}/{repo}/issues.createIssue(owner: string, repo: string, title: string, body?: string) { return this.request(`/repos/${owner}/${repo}/issues`, { method: "POST", body: { title, body }, }); }