Skip to main content
Glama

wp_cache_info

Retrieve WordPress cache configuration and status details to monitor performance and optimize site speed.

Instructions

Get detailed cache configuration and status information.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
siteNoSite ID to get cache info for.

Implementation Reference

  • Registration of the 'wp_cache_info' tool in CacheTools.getTools(), including name, description, input schema (parameters), and handler binding.
    {
      name: "wp_cache_info",
      description: "Get detailed cache configuration and status information.",
      parameters: [
        {
          name: "site",
          type: "string",
          description: "Site ID to get cache info for.",
        },
      ],
      handler: this.handleGetCacheInfo.bind(this),
    },
  • The main handler function for 'wp_cache_info' tool. Resolves the WordPress client, checks if caching is enabled, fetches cache stats, and returns detailed configuration, TTL presets, current stats, invalidation info, and performance benefits.
    async handleGetCacheInfo(params: { site?: string }) {
      return toolWrapper(async () => {
        const client = this.resolveClient(params.site);
    
        if (!(client instanceof CachedWordPressClient)) {
          return {
            caching_enabled: false,
            message: "Caching is disabled for this site.",
            how_to_enable: "Remove DISABLE_CACHE=true from environment variables or set it to false.",
          };
        }
    
        const stats = client.getCacheStats();
    
        return {
          caching_enabled: true,
          cache_configuration: {
            max_size: "Configured in SecurityConfig.cache.maxSize",
            default_ttl: "Configured in SecurityConfig.cache.defaultTTL",
            lru_enabled: "Configured in SecurityConfig.cache.enableLRU",
            stats_enabled: "Configured in SecurityConfig.cache.enableStats",
          },
          ttl_presets: {
            static_data: "4 hours (site settings, user roles)",
            semi_static_data: "2 hours (categories, tags, user profiles)",
            dynamic_data: "15 minutes (posts, pages, comments)",
            session_data: "30 minutes (authentication, current user)",
            realtime_data: "1 minute (real-time data)",
          },
          current_stats: {
            total_entries: stats.cache.totalSize,
            hit_rate: Math.round(stats.cache.hitRate * 100) + "%",
            hits: stats.cache.hits,
            misses: stats.cache.misses,
            evictions: stats.cache.evictions,
          },
          invalidation_info: {
            queue_size: stats.invalidation.queueSize,
            rules_registered: stats.invalidation.rulesCount,
            currently_processing: stats.invalidation.processing,
          },
          performance_benefits: [
            "Reduced API calls to WordPress",
            "Faster response times for repeated requests",
            "Better rate limit utilization",
            "Improved user experience",
          ],
        };
      });
    }
  • Input schema definition for the tool: optional 'site' parameter of type string.
    {
      name: "site",
      type: "string",
      description: "Site ID to get cache info for.",
    },
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states this is a read operation ('Get'), which is helpful, but doesn't mention authentication requirements, rate limits, error conditions, or what format the 'detailed information' returns. For a tool with zero annotation coverage, this leaves significant behavioral gaps.

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, efficient sentence that gets straight to the point with zero wasted words. It's appropriately sized for a simple read operation and front-loads the essential information without unnecessary elaboration.

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?

For a single-parameter read tool with good schema coverage but no annotations or output schema, the description is minimally adequate. It states what the tool does but lacks important context about authentication, return format, and differentiation from sibling cache tools. The absence of an output schema means the description should ideally provide more guidance about what information is returned.

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?

The schema description coverage is 100% with the single 'site' parameter fully documented in the schema. The description adds no additional parameter information beyond what's already in the structured schema, so it meets the baseline expectation without adding extra value.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Get') and the resource ('detailed cache configuration and status information'), making the purpose immediately understandable. It doesn't explicitly differentiate from sibling cache tools like wp_cache_stats or wp_cache_clear, but the specificity of 'configuration and status' provides some implicit distinction.

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 provides no guidance on when to use this tool versus alternatives like wp_cache_stats or wp_cache_clear. There's no mention of prerequisites, context, or comparative use cases with sibling tools, leaving the agent to infer usage patterns from tool names 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/docdyhr/mcp-wordpress'

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