Skip to main content
Glama

get_create_metadata

Retrieve required fields, custom fields, and allowed values for creating Jira issues in a project. Use to understand field requirements before issue creation.

Instructions

Get field requirements and metadata for creating issues in a project. Shows required fields, custom fields, and allowed values.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectKeyYesThe project key (e.g., PROJ, DEV)
issueTypeNoOptional: Filter by specific issue type (e.g., Bug, Task)

Implementation Reference

  • The handler function that implements the core logic for fetching Jira create metadata, processing fields into required/optional lists, and formatting a markdown response with field details and allowed values.
    async handleGetCreateMetadata(args: any) {
      try {
        const { projectKey, issueType } = args;
    
        if (!projectKey) {
          throw new Error('projectKey is required');
        }
    
        // Fetch create metadata for the project
        const params: any = {
          projectKeys: projectKey,
          expand: 'projects.issuetypes.fields',
        };
    
        if (issueType) {
          params.issuetypeNames = issueType;
        }
    
        const metadata = await this.apiClient.get('/issue/createmeta', params);
    
        if (!metadata.projects || metadata.projects.length === 0) {
          throw new Error(`Project ${projectKey} not found or not accessible`);
        }
    
        const project = metadata.projects[0];
        let response = `# Create Metadata for ${project.name} (${project.key})\n\n`;
    
        // List all available issue types
        if (project.issuetypes && project.issuetypes.length > 0) {
          project.issuetypes.forEach((type: any) => {
            response += `## ${type.name}\n\n`;
    
            if (type.fields) {
              const fields = Object.entries(type.fields);
              const requiredFields: any[] = [];
              const optionalFields: any[] = [];
    
              fields.forEach(([key, field]: [string, any]) => {
                if (field.required) {
                  requiredFields.push({ key, ...field });
                } else {
                  optionalFields.push({ key, ...field });
                }
              });
    
              // Show required fields
              if (requiredFields.length > 0) {
                response += `### Required Fields\n\n`;
                requiredFields.forEach((field) => {
                  response += `- **${field.key}** (${field.name})\n`;
                  response += `  - Type: ${field.schema?.type || 'unknown'}\n`;
                  if (field.allowedValues && field.allowedValues.length > 0) {
                    const values = field.allowedValues.map((v: any) => v.name || v.value || v).join(', ');
                    response += `  - Allowed values: ${values}\n`;
                  }
                  response += '\n';
                });
              }
    
              // Show optional fields
              if (optionalFields.length > 0) {
                response += `### Optional Fields\n\n`;
                optionalFields.forEach((field) => {
                  response += `- **${field.key}** (${field.name})\n`;
                  response += `  - Type: ${field.schema?.type || 'unknown'}\n`;
                  if (field.allowedValues && field.allowedValues.length > 0 && field.allowedValues.length < 10) {
                    const values = field.allowedValues.map((v: any) => v.name || v.value || v).join(', ');
                    response += `  - Allowed values: ${values}\n`;
                  }
                  response += '\n';
                });
              }
            }
    
            response += '\n---\n\n';
          });
        }
    
        response += `\nšŸ’” Use these field keys in the \`customFields\` parameter when creating issues.`;
    
        return {
          content: [
            {
              type: 'text',
              text: response,
            },
          ],
        };
      } catch (error: any) {
        return {
          content: [
            {
              type: 'text',
              text: JiraFormatters.formatError(error),
            },
          ],
          isError: true,
        };
      }
    }
  • The input schema defining parameters for the tool: required projectKey and optional issueType.
    {
      name: 'get_create_metadata',
      description: 'Get field requirements and metadata for creating issues in a project. Shows required fields, custom fields, and allowed values.',
      inputSchema: {
        type: 'object',
        properties: {
          projectKey: {
            type: 'string',
            description: 'The project key (e.g., PROJ, DEV)',
          },
          issueType: {
            type: 'string',
            description: 'Optional: Filter by specific issue type (e.g., Bug, Task)',
          },
        },
        required: ['projectKey'],
      },
    },
  • src/index.ts:114-115 (registration)
    Registration in the main tool call switch statement, dispatching calls to the handler method.
    case 'get_create_metadata':
      return this.metadataHandlers.handleGetCreateMetadata(request.params.arguments);
Behavior3/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. It describes the tool as a read operation ('Get'), which implies non-destructive behavior, but doesn't disclose other traits like authentication needs, rate limits, or response format. The description adds some context about what metadata is returned, but lacks behavioral details beyond the basic purpose.

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 and front-loaded, stating the purpose in the first sentence and elaborating with specifics in the second. Both sentences earn their place by clarifying scope and outputs. It could be slightly more structured by explicitly mentioning parameters, but it's efficient with zero waste.

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 moderate complexity (2 parameters, no output schema, no annotations), the description is adequate but incomplete. It explains what metadata is returned but lacks details on behavioral aspects like error handling or usage prerequisites. Without annotations or output schema, it should do more to cover operational context, but it meets minimum viability.

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 input schema has 100% description coverage, with clear documentation for both parameters ('projectKey' and 'issueType'). The description adds no additional parameter semantics beyond what the schema provides, such as examples or constraints. With high schema coverage, the baseline is 3, as the description doesn't compensate but doesn't detract either.

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: 'Get field requirements and metadata for creating issues in a project.' It specifies the verb ('Get') and resource ('field requirements and metadata'), and lists what it shows ('required fields, custom fields, and allowed values'). However, it doesn't explicitly differentiate from siblings like 'create_issue' or 'get_issue' beyond implying it's for metadata before creation.

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 implies usage context ('for creating issues in a project'), suggesting it should be used before 'create_issue' to understand requirements. However, it doesn't explicitly state when to use this tool versus alternatives (e.g., not for actual creation or issue retrieval) or provide exclusions, leaving some ambiguity.

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/pdogra1299/jira-mcp-server'

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