Skip to main content
Glama

cache_list

List all registered caches for an active database instance, showing hit rate and total operations to monitor cache efficiency.

Instructions

List all caches (semantic_cache and agent_cache) registered for the active instance, with hit rate and total ops.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
instanceIdNoConnection ID; defaults to the active instance

Implementation Reference

  • The 'cache_list' MCP tool handler. Lists all caches (semantic_cache and agent_cache) registered for the active instance, with hit rate and total ops. Calls GET /mcp/instance/{id}/caches and formats the response into a human-readable list.
    server.tool(
      'cache_list',
      'List all caches (semantic_cache and agent_cache) registered for the active instance, with hit rate and total ops.',
      {
        instanceId: z.string().regex(/^[a-zA-Z0-9_-]+$/).optional().describe('Connection ID; defaults to the active instance'),
      },
      async (params) => withTelemetry('cache_list', async () => {
        try {
          const id = resolveInstanceId(params.instanceId);
          const data = await apiFetch(`/mcp/instance/${id}/caches`) as {
            caches: Array<{ name: string; type: string; hit_rate: number; total_ops: number; status: string }>;
          };
          if (isLicenseError(data)) {
            return { content: [{ type: 'text' as const, text: licenseErrorResult(data) }] };
          }
          if (data.caches.length === 0) {
            return { content: [{ type: 'text' as const, text: 'No caches registered for this instance.' }] };
          }
          const lines = data.caches.map((c) =>
            `${c.name} (${c.type}, ${c.status}) — hit rate ${(c.hit_rate * 100).toFixed(1)}%, ops ${c.total_ops}`,
          );
          return { content: [{ type: 'text' as const, text: lines.join('\n') }] };
        } catch (err) {
          return {
            content: [{ type: 'text' as const, text: err instanceof Error ? err.message : String(err) }],
            isError: true,
          };
        }
      }),
    );
  • The input schema for 'cache_list' — accepts an optional instanceId parameter (alphanumeric, dash, underscore).
    {
      instanceId: z.string().regex(/^[a-zA-Z0-9_-]+$/).optional().describe('Connection ID; defaults to the active instance'),
    },
  • The tool is registered with the MCP server via server.tool('cache_list', ...) on line 727.
    server.tool(
      'cache_list',
      'List all caches (semantic_cache and agent_cache) registered for the active instance, with hit rate and total ops.',
      {
        instanceId: z.string().regex(/^[a-zA-Z0-9_-]+$/).optional().describe('Connection ID; defaults to the active instance'),
      },
      async (params) => withTelemetry('cache_list', async () => {
        try {
          const id = resolveInstanceId(params.instanceId);
          const data = await apiFetch(`/mcp/instance/${id}/caches`) as {
            caches: Array<{ name: string; type: string; hit_rate: number; total_ops: number; status: string }>;
          };
          if (isLicenseError(data)) {
            return { content: [{ type: 'text' as const, text: licenseErrorResult(data) }] };
          }
          if (data.caches.length === 0) {
            return { content: [{ type: 'text' as const, text: 'No caches registered for this instance.' }] };
          }
          const lines = data.caches.map((c) =>
            `${c.name} (${c.type}, ${c.status}) — hit rate ${(c.hit_rate * 100).toFixed(1)}%, ops ${c.total_ops}`,
          );
          return { content: [{ type: 'text' as const, text: lines.join('\n') }] };
        } catch (err) {
          return {
            content: [{ type: 'text' as const, text: err instanceof Error ? err.message : String(err) }],
            isError: true,
          };
        }
      }),
    );
Behavior2/5

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

No annotations are provided, so the description bears the full burden. It discloses the tool lists caches and returns hit rate/total ops, but does not state whether the operation is read-only, requires permissions, or has side effects. For a listing tool, read-only behavior is implied but not confirmed.

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 is a single sentence with no wasted words. It front-loads the key action and resource, followed by the scope and metrics. Every part adds value.

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

Completeness3/5

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

Given one optional parameter, no output schema, and many siblings, the description is adequate but incomplete. It specifies what caches are listed (both types) and the returned metrics, but does not describe the output format (e.g., whether results are a list or object, sorted, paginated) or how the instanceId parameter affects the listing.

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?

Schema coverage is 100% for the single optional parameter instanceId, with a description already in the schema ('Connection ID; defaults to the active instance'). The tool description adds no additional parameter meaning beyond what the schema provides, so the baseline of 3 is appropriate.

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 uses the specific verb 'List' and identifies the resource as 'all caches (semantic_cache and agent_cache) registered for the active instance', with additional detail about returned metrics (hit rate and total ops). This clearly distinguishes from sibling tools like cache_health (overall health) and cache_list_pending_proposals (pending proposals).

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

Usage Guidelines2/5

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

The description does not provide explicit guidance on when to use this tool versus its siblings (e.g., cache_health for health, cache_list_pending_proposals for pending items). No when-not-to-use or alternative recommendations are given, leaving the agent to infer usage from the description alone.

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/BetterDB-inc/monitor'

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