Skip to main content
Glama

create_issue

Create a new issue in an AtomGit repository to report bugs, request features, or track tasks for open source collaboration.

Instructions

Create a new issue in a AtomGit repository

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ownerYesRepository owner, typically referred to as 'username (owner)'. Case-insensitive.
repoYesRepository name. Case-insensitive.
titleYesIssue title
bodyYesIssue content (in Markdown format)
assigneesNo
milestoneNo
labelsNo

Implementation Reference

  • Core handler function that executes the tool logic by making a POST request to the AtomGit API to create an issue.
    export async function createIssue(
      owner: string,
      repo: string,
      options: z.infer<typeof CreateIssueOptionsSchema>
    ) {
      return atomGitRequest(
        `https://api.atomgit.com/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}/issues`,
        {
          method: "POST",
          body: options,
        },
      );
    }
  • MCP CallToolRequest handler for 'create_issue' that validates input, calls the core createIssue function, handles errors, and returns the formatted response.
    case "create_issue": {
      const args = issues.CreateIssueSchema.parse(request.params.arguments);
      const { owner, repo, ...options } = args;
    
      try {
        console.error(`[DEBUG] Attempting to create issue in ${owner}/${repo}`);
        console.error(`[DEBUG] Issue options:`, JSON.stringify(options, null, 2));
    
        const issue = await issues.createIssue(owner, repo, options);
    
        console.error(`[DEBUG] Issue created successfully`);
        return {
          content: [{ type: "text", text: JSON.stringify(issue, null, 2) }],
        };
      } catch (err) {
        // Type guard for Error objects
        const error = err instanceof Error ? err : new Error(String(err));
    
        console.error(`[ERROR] Failed to create issue:`, error);
    
        if (error instanceof AtomGitResourceNotFoundError) {
          throw new Error(
            `Repository '${owner}/${repo}' not found. Please verify:\n` +
            `1. The repository exists\n` +
            `2. You have correct access permissions\n` +
            `3. The owner and repository names are spelled correctly`
          );
        }
    
        // Safely access error properties
        throw new Error(
          `Failed to create issue: ${error.message}${error.stack ? `\nStack: ${error.stack}` : ''
          }`
        );
      }
    }
  • Zod schema defining the input structure for the create_issue tool, used for validation and JSON schema conversion.
    export const CreateIssueSchema = z.object({
      owner: z.string().describe("Repository owner, typically referred to as 'username (owner)'. Case-insensitive."),
      repo: z.string().describe("Repository name. Case-insensitive."),
      ...CreateIssueOptionsSchema.shape,
    });
  • Zod subschema for issue creation options, composed into the main CreateIssueSchema.
    export const CreateIssueOptionsSchema = z.object({
      title: z.string().describe("Issue title"),
      body: z.string().describe("Issue content (in Markdown format)"),
      assignees: z.array(z.string()).optional(),
      milestone: z.number().optional(),
      labels: z.array(z.string()).optional(),
    });
  • index.ts:121-125 (registration)
    Registration of the 'create_issue' tool in the list returned by ListToolsRequest, including name, description, and input schema.
    {
      name: "create_issue",
      description: "Create a new issue in a AtomGit repository",
      inputSchema: zodToJsonSchema(issues.CreateIssueSchema),
    },

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/kaiyuanxiaobing/atomgit-mcp-server'

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