get_dashboard
Retrieve current revenue dashboard with key metrics for tracking business performance and managing revenue operations.
Instructions
Get current revenue dashboard with all key metrics
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "get_dashboard"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- index.js:150-157 (registration)Registration of the 'get_dashboard' tool including name, description, and empty input schema in the ListToolsRequestSchema handler.
{ name: "get_dashboard", description: "Get current revenue dashboard with all key metrics", inputSchema: { type: "object", properties: {}, }, }, - index.js:153-156 (schema)Input schema for get_dashboard tool: empty object (no parameters required). No output schema defined.
inputSchema: { type: "object", properties: {}, }, - index.js:626-628 (handler)Handler implementation for get_dashboard: calls shared callAPI helper with action 'getDashboard' which proxies to external Google Apps Script API.
case "get_dashboard": result = await callAPI("getDashboard"); break; - index.js:74-131 (helper)Shared helper function callAPI used by get_dashboard (and other tools) to make POST requests to the Google Apps Script web app URL with the action parameter determining the backend operation.
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; } }