get_issue_enums
Retrieve valid values for issue fields like severity, status, and priority to ensure correct data entry when creating or updating MantisBT issues.
Instructions
Return valid ID, name, and (if available) localized label for all issue enum fields.
Use this tool before creating or updating issues to look up the correct value for severity, status, priority, resolution, or reproducibility.
Example response (English installation): { "severity": [{"id": 10, "name": "feature"}, {"id": 50, "name": "minor"}, ...], "status": [{"id": 10, "name": "new"}, {"id": 20, "name": "feedback"}, ...], "priority": [{"id": 10, "name": "none"}, {"id": 30, "name": "normal"}, ...], "resolution": [{"id": 10, "name": "open"}, {"id": 20, "name": "fixed"}, ...], "reproducibility": [{"id": 10, "name": "always"}, {"id": 70, "name": "have not tried"}, ...] }
Example response (localized installation, e.g. German): { "status": [ {"id": 10, "name": "new", "label": "Neu"}, {"id": 20, "name": "feedback", "label": "Feedback"}, {"id": 30, "name": "acknowledged", "label": "Bestätigt"}, ... ], ... }
Fields:
"id" — numeric ID accepted by the API
"name" — the API value to pass to create_issue or update_issue; normally English, but may be localized if the installation has customized enum values in the database
"label" — localized display label shown in the UI (only present when it differs from "name")
Always pass either the "id" or the "name" value to create_issue or update_issue — never the "label". Use the "label" to map user input in the UI language back to the correct "name"/"id" for the API.
Note: on some installations enum values are customized at the database level. In that case "name" itself may be localized (e.g. "kleinerer Fehler" instead of "minor") and no "label" will be present because there is no separate English original. The "name" value returned is always the correct one to use for API calls — regardless of language.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/config.ts:87-185 (handler)The tool 'get_issue_enums' is registered and implemented here. It fetches issue enums configuration using the MantisBT API and formats the result with ID, name, label, and canonical_name fields.
server.registerTool( 'get_issue_enums', { title: 'Get Issue Enum Values', description: `Return valid ID, name, and (if available) localized label for all issue enum fields. Use this tool before creating or updating issues to look up the correct value for severity, status, priority, resolution, or reproducibility. Example response (English installation): { "severity": [{"id": 10, "name": "feature"}, {"id": 50, "name": "minor"}, ...], "status": [{"id": 10, "name": "new"}, {"id": 20, "name": "feedback"}, ...], "priority": [{"id": 10, "name": "none"}, {"id": 30, "name": "normal"}, ...], "resolution": [{"id": 10, "name": "open"}, {"id": 20, "name": "fixed"}, ...], "reproducibility": [{"id": 10, "name": "always"}, {"id": 70, "name": "have not tried"}, ...] } Example response (localized installation, e.g. German): { "status": [ {"id": 10, "name": "new", "label": "Neu"}, {"id": 20, "name": "feedback", "label": "Feedback"}, {"id": 30, "name": "acknowledged", "label": "Bestätigt"}, ... ], ... } Fields: - "id" — numeric ID accepted by the API - "name" — the API value to pass to create_issue or update_issue; normally English, but may be localized if the installation has customized enum values in the database - "label" — localized display label shown in the UI (only present when it differs from "name") Always pass either the "id" or the "name" value to create_issue or update_issue — never the "label". Use the "label" to map user input in the UI language back to the correct "name"/"id" for the API. Note: on some installations enum values are customized at the database level. In that case "name" itself may be localized (e.g. "kleinerer Fehler" instead of "minor") and no "label" will be present because there is no separate English original. The "name" value returned is always the correct one to use for API calls — regardless of language.`, inputSchema: z.object({}), annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, }, }, async () => { try { const params: Record<string, string | number | boolean | undefined> = {}; ISSUE_ENUM_OPTIONS.forEach((opt, i) => { params[`option[${i}]`] = opt; }); const result = await client.get<{ configs: Array<{ option: string; value: string | EnumEntry[] }> }>('config', params); const configs = result.configs ?? []; const keyMap: Record<string, string> = { severity_enum_string: 'severity', status_enum_string: 'status', priority_enum_string: 'priority', resolution_enum_string: 'resolution', reproducibility_enum_string: 'reproducibility', }; const enums: Record<string, Array<{ id: number; name: string; label?: string; canonical_name?: string }>> = {}; for (const { option, value } of configs) { const key = keyMap[option]; if (!key) continue; const canonicalMap = MANTIS_CANONICAL_ENUM_NAMES[key] ?? {}; if (typeof value === 'string') { enums[key] = parseEnumString(value).map(({ id, name }) => { const entry: { id: number; name: string; canonical_name?: string } = { id, name }; const canonical_name = resolveCanonicalName(id, name, canonicalMap); if (canonical_name !== undefined) entry.canonical_name = canonical_name; return entry; }); } else if (Array.isArray(value)) { enums[key] = value.map(({ id, name, label }) => { const entry: { id: number; name: string; label?: string; canonical_name?: string } = { id, name }; if (label && label !== name) entry.label = label; const canonical_name = resolveCanonicalName(id, name, canonicalMap); if (canonical_name !== undefined) entry.canonical_name = canonical_name; return entry; }); } } return { content: [{ type: 'text', text: JSON.stringify(enums, null, 2) }], }; } catch (error) { const msg = error instanceof Error ? error.message : String(error); return { content: [{ type: 'text', text: errorText(msg) }], isError: true }; } } );