Skip to main content
Glama
0xteamhq

Grafana MCP Server

by 0xteamhq

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
NameRequiredDescriptionDefault
idYesThe UUID of the investigation

Implementation Reference

  • 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); } },
  • Zod input schema defining the required 'id' parameter for the tool.
    const GetSiftInvestigationSchema = z.object({ id: z.string().describe('The UUID of the investigation'), });
  • Registers the getSiftInvestigation tool with the MCP server.
    server.registerTool(getSiftInvestigation);
  • 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);

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/0xteamhq/mcp-grafana'

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