Skip to main content
Glama

创建 Issue

gitea_issue_create

Create new issues in Gitea repositories with AI-assisted content generation for bug reports, feature requests, and task 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 executes the gitea_issue_create tool logic: resolves repo context, prepares options, calls Gitea API to create issue, formats and returns result.
    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 'gitea_issue_create' MCP tool, defines its metadata, input schema (Zod), and thin async handler that delegates to the core createIssue function.
    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,
          };
        }
      }
    );
  • src/index.ts:119-121 (registration)
    Calls registerIssueTools to include the gitea_issue_create tool during MCP server initialization.
    // 智能内容生成 (2个): gitea_issue_create, gitea_pr_create
    registerIssueTools(mcpServer, toolContext);
    registerPullRequestTools(mcpServer, toolContext);
Behavior2/5

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

No annotations are provided, so the description carries full burden. It mentions 'AI-assisted issue creation with smart content generation,' hinting at enhanced functionality, but doesn't disclose critical behavioral traits like authentication requirements (implied by token parameter), rate limits, error handling, or what 'smart content generation' entails. This leaves significant gaps for a mutation 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 concise with two sentences that efficiently state the purpose and usage context. It's front-loaded with the core function. However, the second sentence about 'smart content generation' could be more specific to avoid vagueness.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (8 parameters, mutation operation) and lack of annotations and output schema, the description is moderately complete. It covers the basic purpose but misses details on behavioral aspects, return values, and integration with sibling tools. This is adequate for a simple creation tool but could be improved for better agent guidance.

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 description coverage is 100%, providing detailed parameter documentation. The description adds no additional parameter semantics beyond what's in the schema. According to scoring rules, with high schema coverage (>80%), the baseline is 3 even without param info in the description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose as 'Create a new issue' with a specific verb and resource. It distinguishes from sibling tools like 'gitea_pr_create' by focusing on issue creation rather than pull requests. However, it doesn't explicitly differentiate from other issue-related tools like 'gitea_workflow_check_issues' or 'gitea_workflow_sync_board'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides implied usage guidance with 'Use this tool for AI-assisted issue creation with smart content generation,' suggesting this is the primary tool for creating issues with AI assistance. However, it doesn't explicitly state when to use this versus alternatives like manual creation or other workflow tools, nor does it mention prerequisites or exclusions.

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

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