Skip to main content
Glama

read_matrix_snapshot

Retrieve matrix entries for specified topics and date ranges to support revenue tracking and business management.

Instructions

Read Matrix entries for a date range. Returns all entries for specified topics and dates.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
startDateNoStart date YYYY-MM-DD (optional, defaults to beginning)
endDateNoEnd date YYYY-MM-DD (optional, defaults to today)
topicsNoArray of topics to include (optional, defaults to all)

Implementation Reference

  • index.js:420-440 (registration)
    Registers the 'read_matrix_snapshot' tool with the MCP server, including name, description, and input schema.
      name: "read_matrix_snapshot",
      description: "Read Matrix entries for a date range. Returns all entries for specified topics and dates.",
      inputSchema: {
        type: "object",
        properties: {
          startDate: {
            type: "string",
            description: "Start date YYYY-MM-DD (optional, defaults to beginning)"
          },
          endDate: {
            type: "string",
            description: "End date YYYY-MM-DD (optional, defaults to today)"
          },
          topics: {
            type: "array",
            items: { type: "string" },
            description: "Array of topics to include (optional, defaults to all)"
          }
        }
      }
    },
  • Input schema defining optional parameters startDate, endDate, and topics array for filtering matrix entries.
    inputSchema: {
      type: "object",
      properties: {
        startDate: {
          type: "string",
          description: "Start date YYYY-MM-DD (optional, defaults to beginning)"
        },
        endDate: {
          type: "string",
          description: "End date YYYY-MM-DD (optional, defaults to today)"
        },
        topics: {
          type: "array",
          items: { type: "string" },
          description: "Array of topics to include (optional, defaults to all)"
        }
      }
  • Handler in the CallToolRequestSchema switch statement that invokes callAPI('readMatrixSnapshot', args) to execute the tool logic via Google Apps Script.
    case "read_matrix_snapshot":
      result = await callAPI("readMatrixSnapshot", args);
      break;
  • Helper function that makes HTTP POST requests to the Google Apps Script API endpoint, used by all matrix tools including read_matrix_snapshot to delegate execution.
    async function callAPI(action, data = {}) {
      debugLog('=== API CALL START ===');
      debugLog(`Action: ${action}`);
      debugLog(`Data: ${JSON.stringify(data)}`);
    
      try {
        // Build form-encoded body for POST
        const formData = new URLSearchParams();
        formData.append('action', action);
    
        // Add all data fields to form
        for (const [key, value] of Object.entries(data)) {
          if (value !== undefined && value !== null) {
            formData.append(key, value.toString());
          }
        }
    
        const formString = formData.toString();
        debugLog(`FormData: ${formString}`);
        debugLog(`API_URL: ${API_URL}`);
    
        // Use POST with proper content type
        const response = await fetch(API_URL, {
          method: 'POST',
          headers: {
            'Content-Type': 'application/x-www-form-urlencoded',
          },
          body: formString
        });
    
        debugLog(`Response status: ${response.status}`);
        debugLog(`Response ok: ${response.ok}`);
    
        if (!response.ok) {
          debugLog(`Response not OK: ${response.status} ${response.statusText}`);
          throw new Error(`API request failed: ${response.status} ${response.statusText}`);
        }
    
        const text = await response.text();
        debugLog(`Response text length: ${text.length}`);
        debugLog(`Response text: ${text}`);
    
        if (!text) {
          debugLog('ERROR: Empty response from API');
          throw new Error('Empty response from API');
        }
    
        const parsed = JSON.parse(text);
        debugLog(`Parsed successfully: ${JSON.stringify(parsed)}`);
        debugLog('=== API CALL END ===');
        return parsed;
    
      } catch (error) {
        debugLog(`ERROR in callAPI: ${error.message}`);
        debugLog(`ERROR stack: ${error.stack}`);
        throw error;
      }
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. While it indicates this is a read operation and describes the return scope ('all entries for specified topics and dates'), it lacks important behavioral details like whether results are paginated, what format the entries are returned in, potential rate limits, authentication requirements, or error conditions.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately concise with two clear sentences that efficiently communicate the core functionality. The first sentence states the action and scope, while the second clarifies what's returned. No wasted words, though it could be slightly more structured.

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?

For a read operation with 3 parameters and no output schema, the description is insufficient. It doesn't explain the return format, data structure, or what 'Matrix entries' actually contain. With multiple similar Matrix tools in the sibling list, the lack of differentiation guidance is a significant gap in contextual completeness.

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 description coverage is 100%, so the schema already fully documents all three parameters. The description adds minimal value beyond what's in the schema - it mentions date range and topics filtering but provides no additional semantic context about parameter usage, constraints, or interactions.

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 with a specific verb ('Read') and resource ('Matrix entries'), and specifies scope ('for a date range'). However, it doesn't explicitly differentiate from sibling tools like 'get_matrix_row', 'query_matrix', or 'matrix_daily_summary', which appear to be related Matrix 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. With multiple Matrix-related siblings (get_matrix_row, query_matrix, matrix_daily_summary, matrix_time_analysis), there's no indication of how this tool differs in scope, filtering capabilities, or use cases.

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/PromptishOperations/mcpSpec'

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