create_issue_labels
Add predefined or custom labels to issues in a repository to organize and categorize them effectively. Specify repository details, issue number, and label names for streamlined issue management on AtomGit.
Instructions
Add labels to an issue in a repository
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| issue_number | Yes | Issue number | |
| labels | Yes | Array of label names | |
| owner | Yes | Repository owner, typically referred to as 'username'. Case-insensitive. | |
| repo | Yes | Repository name. Case-insensitive. |
Implementation Reference
- operations/label.ts:101-114 (handler)The core handler function that executes the tool logic by making a POST request to the AtomGit API to add labels to a specific issue.export async function createIssueLabels( owner: string, repo: string, issue_number: number, labels: string[] ) { return atomGitRequest( `https://api.atomgit.com/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}/issues/${encodeURIComponent(issue_number)}/labels`, { method: "POST", body: labels, } ); }
- operations/label.ts:18-23 (schema)Zod schema defining the input parameters for the create_issue_labels tool.export const CreateIssueLabelsSchema = z.object({ owner: z.string().describe("Repository owner, typically referred to as 'username'. Case-insensitive."), repo: z.string().describe("Repository name. Case-insensitive."), issue_number: z.number().describe("Issue number"), labels: z.array(z.string()).describe("Array of label names"), });
- index.ts:182-186 (registration)Registration of the tool in the MCP server's listTools handler, specifying name, description, and input schema.{ name: "create_issue_labels", description: "Add labels to an issue in a repository", inputSchema: zodToJsonSchema(label.CreateIssueLabelsSchema), },
- index.ts:465-473 (registration)Dispatch handler in the MCP server's CallToolRequestSchema that parses arguments, calls the core handler, and formats the response.case "create_issue_labels": { const args = label.CreateIssueLabelsSchema.parse(request.params.arguments); const { owner, repo, issue_number, labels } = args; const result = await label.createIssueLabels(owner, repo, issue_number, labels); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }], }; }