Skip to main content
Glama

query_matrix

Search across business topics and time periods to find relevant data in revenue tracking systems. Use keywords to locate specific information within your sales pipeline, email communications, and calendar events.

Instructions

Search Matrix for keyword across topics and dates

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keywordYesSearch term
limitNoMax results (default 50)
topicsNoTopics to search (optional, defaults to all)

Implementation Reference

  • The handler for the 'query_matrix' tool within the CallToolRequestSchema switch statement. It delegates the execution to the shared callAPI helper function, passing 'queryMatrix' as the action and the tool arguments.
    case "query_matrix": result = await callAPI("queryMatrix", args); break;
  • index.js:454-476 (registration)
    Registration of the 'query_matrix' tool in the ListToolsRequestSchema response. Includes the tool name, description, and input schema definition.
    { name: "query_matrix", description: "Search Matrix for keyword across topics and dates", inputSchema: { type: "object", properties: { keyword: { type: "string", description: "Search term" }, topics: { type: "array", items: { type: "string" }, description: "Topics to search (optional, defaults to all)" }, limit: { type: "number", description: "Max results (default 50)" } }, required: ["keyword"] } },
  • Shared helper function callAPI that handles HTTP POST requests to the Google Apps Script backend URL, used by query_matrix and all other proxy tools to execute the actual logic remotely.
    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; } }

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