Skip to main content
Glama

Sync Metadata Cache

sync_metadata

Fetch and cache all projects, users, versions, categories, and tags from MantisBT to provide a complete overview of your installation. Refresh stale data when needed.

Instructions

Fetch all projects and their associated users, versions, categories, and tags from MantisBT and store them in the local metadata cache.

Tags are fetched via the dedicated GET /tags endpoint when available. On installations where that endpoint is missing (MantisBT < 2.26), tags are collected by scanning all issues across all projects.

This is useful for getting a complete overview of your MantisBT installation. The cache is valid for 24 hours by default (configurable via MANTIS_CACHE_TTL env var). Use this tool to refresh stale data.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function that executes the sync_metadata tool, calling fetchAndCacheMetadata to refresh the cache.
      async () => {
        try {
          const data = await fetchAndCacheMetadata(client, cache);
          const projectCount = data.projects.length;
          const summary = data.projects.map((p) => {
            const meta = data.byProject[p.id];
            return `  - ${p.name} (ID ${p.id}): ${meta?.users.length ?? 0} users, ${meta?.versions.length ?? 0} versions, ${meta?.categories.length ?? 0} categories`;
          }).join('\n');
    
          return {
            content: [{
              type: 'text',
              text: `Metadata synced successfully.\n\n${projectCount} project(s):\n${summary}\n\nGlobal tags: ${data.tags.length}`,
            }],
          };
        } catch (error) {
          const msg = error instanceof Error ? error.message : String(error);
          return { content: [{ type: 'text', text: errorText(msg) }], isError: true };
        }
      }
    );
  • Registration of the sync_metadata tool within registerMetadataTools.
      server.registerTool(
        'sync_metadata',
        {
          title: 'Sync Metadata Cache',
          description: `Fetch all projects and their associated users, versions, categories, and tags from MantisBT and store them in the local metadata cache.
    
    Tags are fetched via the dedicated GET /tags endpoint when available. On installations where that endpoint is missing (MantisBT < 2.26), tags are collected by scanning all issues across all projects.
    
    This is useful for getting a complete overview of your MantisBT installation.
    The cache is valid for 24 hours by default (configurable via MANTIS_CACHE_TTL env var).
    Use this tool to refresh stale data.`,
          inputSchema: z.object({}),
          annotations: {
            readOnlyHint: false,
            destructiveHint: false,
            idempotentHint: false,
          },
        },
Behavior4/5

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

Beyond annotations (readOnlyHint: false, idempotentHint: false), the description adds valuable operational context: cache TTL (24 hours), environment variable configuration (MANTIS_CACHE_TTL), and version-specific fallback behavior for tag fetching on MantisBT < 2.26. It does not, however, explain why the operation is non-idempotent or the specific mutation semantics.

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?

The description consists of six well-structured sentences that progress logically: core operation, technical implementation details (tag fetching), use case justification, cache configuration, and explicit usage instruction. No redundancy or filler content is present.

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?

Given the tool's complexity (multi-entity fetching, version compatibility logic, caching side effects) and absence of an output schema, the description adequately covers operational behavior. However, it omits what the tool returns (the cached data? success status?), which is a minor gap for a sync operation.

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?

With zero parameters and 100% schema coverage (trivially), the baseline is 4. The description references the MANTIS_CACHE_TTL environment variable, which provides relevant behavioral context despite not being a formal input parameter, justifying the baseline score.

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 'fetches all projects and their associated users, versions, categories, and tags from MantisBT and store them in the local metadata cache,' providing specific verbs, resources, and scope. It clearly distinguishes from sibling read-tools like get_metadata by emphasizing the write-to-cache behavior.

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

Usage Guidelines4/5

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

The description includes explicit usage guidance ('Use this tool to refresh stale data') and context ('useful for getting a complete overview'). However, it lacks explicit differentiation from siblings like get_metadata or get_metadata_full, missing a 'when-not-to-use' clause that would clarify this is for populating cache versus simply retrieving data.

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