Skip to main content
Glama

toggl_warm_cache

Pre-fetch and cache workspace, project, and client data to improve Toggl Track integration performance by loading frequently accessed information in advance.

Instructions

Pre-fetch and cache workspace, project, and client data for better performance

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workspace_idNoSpecific workspace to warm cache for

Implementation Reference

  • Tool schema definition including name, description, and input schema for 'toggl_warm_cache'.
    {
      name: 'toggl_warm_cache',
      description: 'Pre-fetch and cache workspace, project, and client data for better performance',
      inputSchema: {
        type: 'object',
        properties: {
          workspace_id: {
            type: 'number',
            description: 'Specific workspace to warm cache for'
          }
        }
      },
    },
  • The handler function for the 'toggl_warm_cache' tool that parses arguments, warms the cache using CacheManager, sets cacheWarmed flag, retrieves stats, and returns a success response.
    case 'toggl_warm_cache': {
      const workspaceId = (args?.workspace_id as number | undefined) || defaultWorkspaceId;
      await cache.warmCache(workspaceId);
      cacheWarmed = true;
      
      const stats = cache.getStats();
      
      return {
        content: [{
          type: 'text',
          text: JSON.stringify({ 
            success: true,
            message: 'Cache warmed successfully',
            stats 
          }, null, 2)
        }]
      };
    }
  • Core implementation of cache warming: fetches workspaces, and for specified or first few workspaces, pre-caches projects, clients, and tags.
    async warmCache(workspaceId?: number): Promise<void> {
      // Log to stderr to avoid interfering with MCP stdio protocol
      console.error('Warming cache...');
      
      try {
        // Fetch all workspaces
        const workspaces = await this.getWorkspaces();
        
        // If workspace specified, fetch its entities
        if (workspaceId) {
          await Promise.all([
            this.getProjects(workspaceId),
            this.getClients(workspaceId),
            this.getTags(workspaceId)
          ]);
        } else {
          // Fetch entities for all workspaces (be careful with rate limits)
          for (const ws of workspaces.slice(0, 3)) { // Limit to first 3 workspaces
            await Promise.all([
              this.getProjects(ws.id),
              this.getClients(ws.id),
              this.getTags(ws.id)
            ]);
          }
        }
        
        console.error('Cache warmed successfully');
      } catch (error) {
        console.error('Failed to warm cache:', error);
      }
    }
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 mentions caching for performance but lacks details on side effects (e.g., network usage, data freshness), permissions required, or error handling. This is inadequate for a tool that likely involves data fetching and storage operations.

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 directly states the tool's purpose without unnecessary words. It is appropriately sized and front-loaded, making it easy to understand quickly.

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

Completeness2/5

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

Given the complexity of a caching tool with no annotations and no output schema, the description is insufficient. It doesn't explain what data is cached, how long it persists, performance implications, or return values, leaving significant gaps for agent understanding.

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 input schema has 100% description coverage, with the parameter 'workspace_id' documented as 'Specific workspace to warm cache for.' The description adds no additional parameter semantics beyond this, so it meets the baseline for high schema coverage without compensating further.

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 tool's purpose: 'Pre-fetch and cache workspace, project, and client data for better performance.' It specifies the action (pre-fetch and cache) and resources (workspace, project, client data), but doesn't explicitly differentiate from sibling tools like 'toggl_cache_stats' or 'toggl_clear_cache' that also involve cache operations.

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. It doesn't mention prerequisites, optimal timing, or compare it to sibling tools such as 'toggl_list_workspaces' or 'toggl_cache_stats', leaving the agent without context for selection.

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/verygoodplugins/mcp-toggl'

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