get_sift_investigation
Retrieve an existing Sift investigation using its unique UUID identifier to access detailed incident data and analysis within Grafana's monitoring environment.
Instructions
Retrieves an existing Sift investigation by its UUID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The UUID of the investigation |
Implementation Reference
- src/tools/sift.ts:95-105 (handler)The async handler function that executes the get_sift_investigation tool logic: creates a Sift API client and fetches the investigation by ID.handler: async (params, context: ToolContext) => { try { const client = createSiftClient(context.config.grafanaConfig); const response = await client.get(`/api/v1/investigations/${params.id}`); return createToolResult(response.data); } catch (error: any) { return createErrorResult(error.response?.data?.message || error.message); } },
- src/tools/sift.ts:10-12 (schema)Zod input schema defining the required 'id' parameter for the tool.const GetSiftInvestigationSchema = z.object({ id: z.string().describe('The UUID of the investigation'), });
- src/tools/sift.ts:217-217 (registration)Registers the getSiftInvestigation tool with the MCP server.server.registerTool(getSiftInvestigation);
- src/tools/sift.ts:34-57 (helper)Helper function to create an Axios client configured for Sift API, handling auth and base URL.function createSiftClient(config: any) { const headers: any = { 'User-Agent': 'mcp-grafana/1.0.0', 'Content-Type': 'application/json', }; if (config.serviceAccountToken) { headers['Authorization'] = `Bearer ${config.serviceAccountToken}`; } else if (config.apiKey) { headers['Authorization'] = `Bearer ${config.apiKey}`; } // Sift uses a different base URL pattern const baseUrl = config.url.replace(/\/$/, ''); const siftUrl = baseUrl.includes('grafana.net') ? baseUrl.replace('grafana.net', 'sift.grafana.net') : `${baseUrl}/api/plugins/grafana-sift-app/resources`; return axios.create({ baseURL: siftUrl, headers, timeout: 60000, // Longer timeout for investigations }); }
- src/cli.ts:126-126 (registration)Invokes registration of Sift tools, including get_sift_investigation, on the MCP server.registerSiftTools(server);