Skip to main content
Glama
0xteamhq

Grafana MCP Server

by 0xteamhq

list_teams

Search for Grafana teams using a query string to find and retrieve detailed information about matching teams within your Grafana instance.

Instructions

Search for Grafana teams by a query string. Returns a list of matching teams with details

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryNoThe query to search for teams

Implementation Reference

  • The handler function for the 'list_teams' tool. It instantiates a GrafanaClient, calls listTeams with the optional query parameter, formats the team data (id, name, email, memberCount), and returns the result or an error.
    handler: async (params, context: ToolContext) => {
      try {
        const client = new GrafanaClient(context.config.grafanaConfig);
        const teams = await client.listTeams(params.query);
        
        // Format the response
        const formatted = teams.map(team => ({
          id: team.id,
          name: team.name,
          email: team.email,
          memberCount: team.memberCount,
        }));
        
        return createToolResult(formatted);
      } catch (error: any) {
        return createErrorResult(error.message);
      }
    },
  • Zod schema defining the input for list_teams tool: optional 'query' string to search for teams.
    const ListTeamsSchema = z.object({
      query: z.string().optional().describe('The query to search for teams'),
    });
  • Registers the 'list_teams' tool definition with the MCP server inside the registerAdminTools function.
    server.registerTool(listTeams);
  • GrafanaClient method that performs the API call to /api/teams/search with optional query parameter, used by the tool handler.
    async listTeams(query?: string): Promise<Team[]> {
      try {
        const response = await this.client.get('/api/teams/search', {
          params: { query },
        });
        return response.data.teams;
      } catch (error) {
        this.handleError(error);
      }
    }
  • src/cli.ts:123-123 (registration)
    Invocation of registerAdminTools which registers the 'list_teams' tool, conditionally if 'admin' category is enabled.
    registerAdminTools(server);
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions the action ('Search') and outcome ('Returns a list'), but fails to detail critical behaviors like pagination, rate limits, authentication requirements, error handling, or what 'details' includes. For a search tool with zero annotation coverage, this is a significant gap in transparency.

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

Conciseness4/5

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

The description is concise and front-loaded, consisting of two clear sentences that state the action and outcome without unnecessary details. It efficiently communicates the core functionality, though it could be slightly improved by integrating usage context without adding bulk.

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 complexity of a search tool with no annotations and no output schema, the description is incomplete. It lacks details on behavioral traits, output format specifics, and usage guidelines. While it states the purpose, it does not provide enough context for an agent to fully understand how to invoke and interpret results effectively.

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 'query' parameter documented as 'The query to search for teams.' The description adds no additional parameter semantics beyond this, such as query syntax examples or search scope. With high schema coverage, the baseline score of 3 is appropriate, as the schema handles the parameter documentation adequately.

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 tool's purpose: 'Search for Grafana teams by a query string. Returns a list of matching teams with details.' It specifies the verb ('Search'), resource ('Grafana teams'), and outcome. However, it does not explicitly differentiate from sibling tools like 'list_oncall_teams' or 'list_users_by_org', which reduces clarity in distinguishing use cases.

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 lacks context such as prerequisites, when to choose this over other listing tools (e.g., 'list_oncall_teams'), or any exclusions. This absence of usage context leaves the agent without direction for tool selection.

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