Skip to main content
Glama

gemini_info

Check connectivity, get version, or list models, sessions, and extensions for the Gemini CLI diagnostics tool.

Instructions

Gemini CLI diagnostics: check connectivity, get version, list sessions or extensions.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionYesping: test CLI works, version: CLI version, list_models: available models and aliases, list_sessions: past sessions, list_extensions: available extensions.

Implementation Reference

  • The handler function for the `gemini_info` MCP tool, which implements various diagnostics actions (ping, version, etc.) by executing the Gemini CLI.
    server.tool(
      "gemini_info",
      "Gemini CLI diagnostics: check connectivity, get version, list sessions or extensions.",
      {
        action: z.enum(["ping", "version", "list_models", "list_sessions", "list_extensions"]).describe(
          "ping: test CLI works, version: CLI version, list_models: available models and aliases, list_sessions: past sessions, list_extensions: available extensions."
        ),
      },
      async ({ action }) => {
        try {
          let result: GeminiResult;
    
          switch (action) {
            case "ping": {
              // Use --version for lightweight connectivity check (no API call, no tokens)
              result = await runGeminiRaw({ args: ["--version"], timeoutMs: 10_000 });
              const version = stripNoise(result.stdout).trim();
              if (result.code === 0 && version) {
                return {
                  content: [{
                    type: "text" as const,
                    text: `Gemini CLI OK (v${version})`,
                  }],
                };
              }
              return {
                content: [{
                  type: "text" as const,
                  text: `Gemini CLI error (exit ${result.code}):\n${result.stderr || result.stdout}`,
                }],
                isError: true,
              };
            }
    
            case "list_models":
              return {
                content: [{
                  type: "text" as const,
                  text: `Available Gemini models:\n${formatModelList()}\n\nDefault: ${DEFAULT_MODEL}\nFree tier: 60 RPM / 1000 req/day`,
                }],
              };
    
            case "version":
              result = await runGeminiRaw({ args: ["--version"], timeoutMs: 10_000 });
              return {
                content: [{
                  type: "text" as const,
                  text: stripNoise(result.stdout) || result.stderr.trim() || "unknown",
                }],
              };
    
            case "list_sessions":
              result = await runGeminiRaw({ args: ["--list-sessions"], timeoutMs: 10_000 });
              return {
                content: [{
                  type: "text" as const,
                  text: truncate(stripNoise(result.stdout) || "(no sessions)", MAX_RESPONSE_CHARS),
                }],
              };
    
            case "list_extensions":
              result = await runGeminiRaw({ args: ["-l"], timeoutMs: 10_000 });
              return {
                content: [{
                  type: "text" as const,
                  text: stripNoise(result.stdout) || "(no extensions)",
                }],
              };
    
            default: {
              const _exhaustive: never = action;
              return {
                content: [{ type: "text" as const, text: `Unknown action: ${_exhaustive}` }],
                isError: true,
              };
            }
          }
        } catch (err: unknown) {
          const message = err instanceof Error ? err.message : String(err);
          return {
            content: [{ type: "text" as const, text: `Error: ${message}` }],
            isError: true,
Behavior3/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. It implies read-only behavior through terms like 'diagnostics' and 'list', but fails to disclose output formats, error conditions, or whether these operations are cached/live. It meets minimum expectations for a metadata tool but lacks rich behavioral context.

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 front-loads the category ('Gemini CLI diagnostics') and follows with a colon-delimited list of specific capabilities. No words are wasted.

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

Completeness4/5

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

For a simple single-parameter tool with complete schema coverage, the description is adequate. It covers the primary use cases (though misses list_models in prose). No output schema exists, but the description sufficiently indicates the return type nature (diagnostic info).

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?

With 100% schema coverage, the baseline is 3. The description maps most enum values to user-friendly intents (ping→connectivity, etc.) but omits 'list_models' entirely. It adds minimal semantic value beyond what the schema's detailed descriptions already provide.

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 identifies the tool's purpose using specific verbs (check, get, list) and identifies the resource (Gemini CLI diagnostics). It implicitly distinguishes from sibling 'gemini_query' by focusing on introspection/metadata rather than active querying, though explicit differentiation would strengthen this further.

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 lists capabilities but provides no explicit guidance on when to use this tool versus 'gemini_query'. It lacks prerequisites (e.g., 'use ping to verify connectivity before querying') or exclusion criteria that would help an agent select the correct tool.

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/xjoker/gemini-cli-mcp'

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