Skip to main content
Glama

Get Cached Metadata

get_metadata
Read-onlyIdempotent

Retrieve cached metadata summaries from MantisBT including project counts, tag counts, and per-project user, version, and category statistics. Automatically syncs if cache is expired.

Instructions

Return a compact summary of cached MantisBT metadata: project count, tag count, and per-project counts of users, versions, and 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. For full lists use: list_projects (projects), get_project_users / get_project_versions / get_project_categories (per-project data), list_tags (tags).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The implementation of the get_metadata tool, which provides a summary of cached MantisBT metadata.
      server.registerTool(
        'get_metadata',
        {
          title: 'Get Cached Metadata',
          description: `Return a compact summary of cached MantisBT metadata: project count, tag count, and per-project counts of users, versions, and 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. For full lists use: list_projects (projects), get_project_users / get_project_versions / get_project_categories (per-project data), list_tags (tags).`,
          inputSchema: z.object({}),
          annotations: {
            readOnlyHint: true,
            destructiveHint: false,
            idempotentHint: true,
          },
        },
        async () => {
          try {
            const data: CachedMetadata = await cache.loadIfValid() ?? await fetchAndCacheMetadata(client, cache);
    
            const summary = {
              projects: data.projects.length,
              tags: data.tags.length,
              byProject: Object.fromEntries(
                data.projects.map((p) => {
                  const meta = data.byProject[p.id];
                  return [String(p.id), {
                    name: p.name,
                    users: meta?.users.length ?? 0,
                    versions: meta?.versions.length ?? 0,
                    categories: meta?.categories.length ?? 0,
                  }];
                })
              ),
              cached_at: new Date(data.timestamp).toISOString(),
              ttl_seconds: cache.getRemainingTtlSeconds(data.timestamp),
            };
            return {
              content: [{ type: 'text', text: JSON.stringify(summary, null, 2) }],
            };
          } catch (error) {
            const msg = error instanceof Error ? error.message : String(error);
            return { content: [{ type: 'text', text: errorText(msg) }], isError: true };
          }
        }
      );
Behavior4/5

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

Annotations establish read-only/idempotent safety. The description adds critical behavioral context: the 24-hour TTL expiration logic, automatic sync side-effect when cache is stale, and specific definition of 'compact summary' (counts vs full objects). It does not mention error states or performance characteristics, preventing a 5.

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 sentences with zero waste. First sentence defines the return payload specifically. Second sentence explains cache lifecycle (TTL, auto-sync). Third sentence provides sibling alternatives. Information is perfectly front-loaded and dense.

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?

Despite lacking an output schema, the description explicitly details the return structure (specific counts provided). It compensates for missing output schema by enumerating the summary fields. It covers caching behavior and alternative tools comprehensively for a parameter-less metadata tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Input schema contains zero parameters (empty object). As per guidelines, 0 params warrants baseline 4. The description appropriately does not invent parameter semantics where none exist.

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?

Description uses specific verb 'Return' and clearly defines the resource as 'compact summary of cached MantisBT metadata' with explicit details (project count, tag count, per-project counts). It effectively distinguishes from sibling 'sync_metadata' (force refresh) and 'get_metadata_full' implied by the naming, while contrasting with list_projects/get_project_users for full data.

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?

Provides explicit when-to-use guidance: 'Use sync_metadata to force a refresh' and maps specific alternatives for full data lists ('For full lists use: list_projects...'). It also clarifies automatic behavior: 'If the cache does not exist or has expired... it will automatically sync first,' helping the agent understand latency implications.

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