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;
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. '创建新的工作项' implies a write operation (creation), but it doesn't disclose any behavioral traits such as required permissions, whether the operation is idempotent, what happens on failure, or the expected response format. For a mutation tool with zero annotation coverage, this is a significant gap in transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single phrase '创建新的工作项', which is extremely concise and front-loaded with the core action. There is no wasted language or unnecessary elaboration, making it efficient for quick understanding by an AI agent.

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

Completeness2/5

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

Given the complexity of a creation tool with 5 required parameters, no annotations, and no output schema, the description is incomplete. It doesn't explain the return values, error conditions, or behavioral aspects like side effects. While the schema covers parameters well, the overall context for safe and effective tool invocation is lacking, especially for a mutation operation.

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?

The description adds no parameter semantics beyond what the input schema provides. However, schema description coverage is 100%, with all parameters clearly documented in the schema (e.g., 'priority' with optional values, 'type' with enum-like descriptions). This meets the baseline of 3, as the schema does the heavy lifting, but the description doesn't compensate with additional context like default values or usage tips.

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 '创建新的工作项' (Create new work item) clearly states the verb 'create' and the resource 'work item', which is specific and unambiguous. It distinguishes from siblings like 'delete_issue' or 'list_issues' by indicating creation rather than deletion or listing. However, it doesn't explicitly differentiate from 'create_project', which creates a different resource type, so it's not a perfect 5.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing an existing project), exclusions, or comparisons to siblings like 'create_project' for creating projects instead of issues, or 'list_issues' for viewing existing ones. This leaves the agent without context for tool selection.

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

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