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);
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states 'Retrieves an existing Sift investigation,' implying a read-only operation, but doesn't cover aspects like authentication requirements, rate limits, error handling, or what data is returned. This leaves significant gaps in understanding the tool's behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It's front-loaded and wastes no space, making it highly concise and well-structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the lack of annotations and output schema, the description is incomplete. It doesn't explain what an 'investigation' entails, what data is retrieved, or how it differs from sibling tools. For a tool with no structured behavioral data, more context is needed to fully understand its use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, with the 'id' parameter documented as 'The UUID of the investigation.' The description adds no additional parameter semantics beyond this, so it meets the baseline of 3 for high schema coverage without extra value.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Retrieves') and resource ('an existing Sift investigation'), making the purpose understandable. However, it doesn't differentiate from sibling tools like 'get_sift_analysis' or 'list_sift_investigations', which would require more specific context about what distinguishes an 'investigation' from 'analysis' or 'list' operations.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools like 'list_sift_investigations' for browsing or 'get_sift_analysis' for related data, nor does it specify prerequisites or exclusions, leaving usage context unclear.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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