Skip to main content
Glama

gitea_issue_create

Create new issues in Gitea repositories with AI-assisted content generation for efficient project management and bug tracking.

Instructions

Create a new issue. Use this tool for AI-assisted issue creation with smart content generation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ownerNoRepository owner. Uses context if not provided
repoNoRepository name. Uses context if not provided
titleYesIssue title
bodyNoIssue body/description
assigneesNoUsernames to assign
labelsNoLabel IDs to attach
milestoneNoMilestone ID
tokenNoOptional API token to override default authentication

Implementation Reference

  • Core handler function that resolves repository context, constructs CreateIssueOptions, makes POST request to Gitea API to create issue, and returns formatted success response with issue details.
    export async function createIssue( ctx: IssueToolsContext, args: { owner?: string; repo?: string; title: string; body?: string; assignee?: string; assignees?: string[]; milestone?: number; labels?: number[]; due_date?: string; token?: string; } ) { logger.debug({ args }, 'Creating issue'); const { owner, repo } = ctx.contextManager.resolveOwnerRepo(args.owner, args.repo); const createOptions: CreateIssueOptions = { title: args.title, body: args.body, assignee: args.assignee, assignees: args.assignees, milestone: args.milestone, labels: args.labels, due_date: args.due_date, }; const issue = await ctx.client.post<GiteaIssue>( `/repos/${owner}/${repo}/issues`, createOptions, args.token ); logger.info({ owner, repo, issue: issue.number }, 'Issue created successfully'); return { success: true, issue: { id: issue.id, number: issue.number, title: issue.title, body: issue.body, state: issue.state, user: { id: issue.user.id, login: issue.user.login, }, labels: issue.labels.map((l) => ({ id: l.id, name: l.name, color: l.color })), assignees: issue.assignees?.map((a) => ({ id: a.id, login: a.login })), milestone: issue.milestone ? { id: issue.milestone.id, title: issue.milestone.title } : null, html_url: issue.html_url, created_at: issue.created_at, updated_at: issue.updated_at, }, }; }
  • Registers the MCP tool 'gitea_issue_create' with mcpServer.registerTool, providing title, description, Zod inputSchema, and an async wrapper handler that delegates to IssueTools.createIssue and handles errors.
    // gitea_issue_create - 创建 Issue (智能内容生成) mcpServer.registerTool( 'gitea_issue_create', { title: '创建 Issue', description: 'Create a new issue. Use this tool for AI-assisted issue creation with smart content generation.', inputSchema: z.object({ owner: z.string().optional().describe('Repository owner. Uses context if not provided'), repo: z.string().optional().describe('Repository name. Uses context if not provided'), title: z.string().min(1).describe('Issue title'), body: z.string().optional().describe('Issue body/description'), assignees: z.array(z.string()).optional().describe('Usernames to assign'), labels: z.array(z.number()).optional().describe('Label IDs to attach'), milestone: z.number().optional().describe('Milestone ID'), token: tokenSchema, }), }, async (args) => { try { const result = await IssueTools.createIssue(toolsContext, args as any); return { content: [{ type: 'text' as const, text: JSON.stringify(result, null, 2) }], }; } catch (error: unknown) { const errorMessage = error instanceof Error ? error.message : String(error); return { content: [{ type: 'text' as const, text: `Error: ${errorMessage}` }], isError: true, }; } } );
  • Zod schema defining the input parameters for the gitea_issue_create tool, including optional owner/repo (context-resolved), required title, and optional body, assignees, labels, milestone, token.
    inputSchema: z.object({ owner: z.string().optional().describe('Repository owner. Uses context if not provided'), repo: z.string().optional().describe('Repository name. Uses context if not provided'), title: z.string().min(1).describe('Issue title'), body: z.string().optional().describe('Issue body/description'), assignees: z.array(z.string()).optional().describe('Usernames to assign'), labels: z.array(z.number()).optional().describe('Label IDs to attach'), milestone: z.number().optional().describe('Milestone ID'), token: tokenSchema, }),

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/SupenBysz/gitea-mcp-tool'

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