Read from the Logflare API
execute_readExecute JavaScript functions to read data from the Logflare Management API using only GET requests, ensuring no state changes.
Instructions
Read data from the Logflare Management API by writing JavaScript. Only GET requests are allowed — use execute_write for anything that changes state.
Example: async () => (await api.request({ method: 'GET', path: '/api/sources' })).data
Your code is an async arrow function that returns a value. In scope:
declare const api: { request<T = unknown>(options: { method?: "GET" | "POST" | "PUT" | "PATCH" | "DELETE"; // default GET path: string; // e.g. "/api/sources" — see the search tool query?: Record<string, string | number | boolean | undefined>; body?: unknown; // JSON by default contentType?: string; // overrides the default application/json rawBody?: boolean; // send body as-is (no JSON.stringify) }): Promise<{ status: number; ok: boolean; data: T }>; };
Returns a JSON object — result (or error), calledEndpoints, and stdout/stderr — wrapped in an untrusted-data envelope. Use the search tool first to find paths. Access-token, backend, and team endpoints (/api/access-tokens, /api/backends, /api/teams) are blocked — they mint/reveal access tokens, backend connection config, or the account's master API key.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | Async arrow function using `api`; must return a value. |