get_metadata
Retrieve cached MantisBT project, user, version, and category data. Automatically syncs if cache is expired or missing, ensuring access to current metadata for issue management.
Instructions
Return cached MantisBT metadata (projects, users, versions, categories).
If the cache does not exist or has expired (default TTL: 24 hours), it will automatically sync first. Use sync_metadata to force a refresh.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/metadata.ts:222-234 (handler)The handler function for the get_metadata tool. It attempts to load metadata from the cache or fetches and caches it if invalid or missing.
async () => { try { const data: CachedMetadata = await cache.loadIfValid() ?? await fetchAndCacheMetadata(client, cache); return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }], }; } catch (error) { const msg = error instanceof Error ? error.message : String(error); return { content: [{ type: 'text', text: errorText(msg) }], isError: true }; } } ); - src/tools/metadata.ts:207-221 (registration)The registration of the get_metadata tool within the MCP server.
server.registerTool( 'get_metadata', { title: 'Get Cached Metadata', description: `Return cached MantisBT metadata (projects, users, versions, categories). If the cache does not exist or has expired (default TTL: 24 hours), it will automatically sync first. Use sync_metadata to force a refresh.`, inputSchema: z.object({}), annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, }, },