Skip to main content
Glama

Get Issue Fields

get_issue_fields
Read-onlyIdempotent

Discover valid field names for querying MantisBT issues to ensure your API requests only reference existing server fields.

Instructions

Return all field names that are valid for the "select" parameter of list_issues and get_issue.

Fields are discovered by fetching a sample issue from MantisBT (which reflects the server's active configuration — e.g. whether eta, projection, or profile fields are enabled) and merging the result with fields that MantisBT omits when empty (notes, attachments, relationships, etc.). The result is cached with the same TTL as the metadata cache.

Use this tool before constructing a "select" string to ensure you only request fields that exist on this server.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idNoOptional project ID to scope the sample issue fetch

Implementation Reference

  • The implementation and registration of the "get_issue_fields" tool. It samples fields from issues or uses static defaults, and manages caching.
      server.registerTool(
        'get_issue_fields',
        {
          title: 'Get Issue Fields',
          description: `Return all field names that are valid for the "select" parameter of list_issues and get_issue.
    
    Fields are discovered by fetching a sample issue from MantisBT (which reflects the server's active configuration — e.g. whether eta, projection, or profile fields are enabled) and merging the result with fields that MantisBT omits when empty (notes, attachments, relationships, etc.). The result is cached with the same TTL as the metadata cache.
    
    Use this tool before constructing a "select" string to ensure you only request fields that exist on this server.`,
          inputSchema: z.object({
            project_id: z.coerce.number().int().positive().optional().describe('Optional project ID to scope the sample issue fetch'),
          }),
          annotations: {
            readOnlyHint: true,
            destructiveHint: false,
            idempotentHint: true,
          },
        },
        async ({ project_id }) => {
          try {
            const cached = await cache.loadIssueFields();
            if (cached) {
              return {
                content: [{ type: 'text', text: JSON.stringify({ fields: cached, source: 'cache' }, null, 2) }],
              };
            }
    
            const params: Record<string, string | number | boolean | undefined> = {
              page: 1,
              page_size: 1,
              project_id,
            };
            const result = await client.get<MantisPaginatedIssues>('issues', params);
            const issues = result.issues ?? [];
    
            let fields: string[];
            if (issues.length === 0) {
              fields = STATIC_ISSUE_FIELDS;
            } else {
              const discovered = Object.keys(issues[0]);
              fields = Array.from(new Set([...discovered, ...EMPTY_STRIPPED_FIELDS])).sort();
            }
    
            await cache.saveIssueFields(fields);
            return {
              content: [{ type: 'text', text: JSON.stringify({ fields, source: issues.length > 0 ? 'live' : 'static' }, null, 2) }],
            };
          } catch (error) {
            const msg = error instanceof Error ? error.message : String(error);
            return { content: [{ type: 'text', text: errorText(msg) }], isError: true };
          }
        }
      );
Behavior5/5

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

Adds substantial context beyond annotations: explains the discovery mechanism (fetching sample issue, merging with omitted fields), server configuration dependencies (eta, projection, profile fields), caching behavior (TTL tied to metadata cache), and why fields might be missing (MantisBT omits when empty).

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?

Three well-structured sentences: purpose statement upfront, implementation details in the middle, and usage guideline at the end. No redundant words; every sentence provides distinct value (what it does, how it works, when to use it).

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

Completeness4/5

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

For a discovery tool with no output schema, the description adequately explains the return value (field names) and their characteristics. Could be improved by hinting at the return format (array of strings vs objects), but covers the essential behavioral context given the simple input schema.

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?

With 100% schema coverage, the baseline is 3. The description mentions 'fetching a sample issue' which contextually relates to the project_id parameter's purpose (scoping the fetch), but does not explicitly add semantic detail beyond the schema's description of project_id.

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

Purpose5/5

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

The description explicitly states the tool 'Return[s] all field names that are valid for the 'select' parameter of list_issues and get_issue,' providing a specific verb, resource, and clear scope that distinguishes it from sibling tools like get_issue or get_metadata.

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

Usage Guidelines5/5

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

Explicitly states 'Use this tool before constructing a 'select' string to ensure you only request fields that exist on this server,' providing clear temporal guidance (when to use) and implicitly contrasting with the alternative of guessing field names.

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/dpesch/mantisbt-mcp-server'

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