Skip to main content
Glama

create_issue

Generate and manage new work items such as tasks, defects, requirements, or epics in CODING DevOps projects by specifying title, description, priority, and type using standardized MCP protocols.

Instructions

创建新的工作项

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
descriptionYes事项描述
nameYes事项标题
priorityYes优先级,可选值为:0 - 低 1 - 中 2 - 高 3 - 紧急
projectNameYes项目名称
typeYes事项类型,可选值为: DEFECT - 缺陷 REQUIREMENT - 需求 MISSION - 任务 EPIC - 史诗

Implementation Reference

  • The main handler function that performs input validation, initializes the CodingConnection, calls the low-level API to create the issue, and returns a formatted MCP response.
    export async function createIssue(args: { projectName: string; name: string; type: string; priority: string; description: string; parentCode?: number; }, config: CodingDevOpsConfig) { if (!args.projectName) { throw new McpError(ErrorCode.InvalidParams, 'projectName01 is required'); } if (!args.name) { throw new McpError(ErrorCode.InvalidParams, 'Name is required'); } if (!args.type) { throw new McpError(ErrorCode.InvalidParams, 'Type is required'); } if (!args.priority) { throw new McpError(ErrorCode.InvalidParams, 'Priority is required'); } if (!args.description) { throw new McpError(ErrorCode.InvalidParams, 'Description is required'); } // 验证事项类型 const validTypes = ['DEFECT', 'REQUIREMENT', 'MISSION', 'EPIC']; if (!validTypes.includes(args.type)) { throw new McpError( ErrorCode.InvalidParams, `Invalid type. Must be one of: ${validTypes.join(', ')}` ); } CodingConnection.initialize(config); const connection = CodingConnection.getInstance(); const issue = await connection.createIssue({ projectName: args.projectName, name: args.name, type: args.type, priority: args.priority, description: args.description, parentCode: args.parentCode }); return { content: [ { type: 'text', text: `Successfully created issue: ${issue.Name} (${issue.Code})`, }, ], }; }
  • Input schema and metadata definition for the 'create_issue' tool used for tool listing and validation.
    { name: 'create_issue', description: '创建新的工作项', inputSchema: { type: 'object', properties: { projectName: { type: 'string', description: '项目名称', }, name: { type: 'string', description: '事项标题', }, type: { type: 'string', description: '事项类型,可选值为: DEFECT - 缺陷 REQUIREMENT - 需求 MISSION - 任务 EPIC - 史诗', }, priority: { type: 'string', description: '优先级,可选值为:0 - 低 1 - 中 2 - 高 3 - 紧急', }, description: { type: 'string', description: '事项描述', }, parentCode: { type: 'number', description: '父事项编号,如果设置了此字段,创建的事项将成为该父事项的子事项', } }, required: ['projectName', 'name', 'type', 'priority', 'description'], } },
  • src/index.ts:121-122 (registration)
    Registration in the main MCP server request handler: switch case that dispatches 'create_issue' calls to the tool implementation.
    case 'create_issue': result = await tools.issue.createIssue(request.params.arguments);
  • Tool instance registration in issueTools module: typed wrapper that passes config to the createIssue handler.
    createIssue: (args: { projectName: string; name: string; type: string; priority: string; description: string; parentCode?: number; }) => createIssue(args, config),
  • Low-level helper method in CodingConnection that performs the actual HTTP API call to create the issue.
    public async createIssue(params: { projectName: string; name: string; type: string; priority: string; description: string; parentCode?: number; }): Promise<CodingIssue> { const requestBody = { Action: 'CreateIssue', ProjectName: params.projectName, Name: params.name, Type: params.type, Priority: params.priority, Description: params.description, ParentCode: params.parentCode }; const response = await axios.post<{ Response: { Issue: CodingIssue; RequestId: string; }; }>( CodingConnection.config.apiUrl, requestBody, { headers: { 'Authorization': `token ${CodingConnection.config.token}`, 'Content-Type': 'application/json', 'Accept': 'application/json' } } ); return response.data.Response.Issue; }

Other Tools

Related 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/yupengfei1209/coding_devops_mcp_server'

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