Skip to main content
Glama

check_cli_status

Verify which code review CLIs (Codex/OpenAI and Gemini) are installed and available before requesting code reviews to ensure compatibility.

Instructions

Check which code review CLIs (Codex/OpenAI and Gemini) are installed and available. Use this before requesting reviews to see what's available.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main execution logic for the 'check_cli_status' tool. Checks CLI availability and returns a formatted Markdown status report.
    private async handleCheckCLIStatus() {
      // Ensure detection has completed
      if (!this.cliAvailability.checked) {
        await this.detectCLIs();
      }
    
      let status = "# CLI Status Check\n\n";
    
      if (this.cliAvailability.codex) {
        status += "✓ **OpenAI CLI (Codex)**: Available\n";
      } else {
        status += "✗ **OpenAI CLI (Codex)**: Not found\n";
        status += "  - Install: `npm install -g openai`\n";
        status += "  - Set API key: `export OPENAI_API_KEY='your-key'`\n";
      }
    
      status += "\n";
    
      if (this.cliAvailability.gemini) {
        status += "✓ **Gemini CLI**: Available\n";
      } else {
        status += "✗ **Gemini CLI**: Not found\n";
        status += "  - See setup instructions in README.md\n";
        status += "  - Set API key: `export GOOGLE_API_KEY='your-key'`\n";
      }
    
      status += "\n";
    
      if (this.cliAvailability.codex && this.cliAvailability.gemini) {
        status += "**Status**: Both review CLIs are available. All features enabled.\n";
      } else if (this.cliAvailability.codex || this.cliAvailability.gemini) {
        status += "**Status**: One review CLI is available. Partial functionality enabled.\n";
      } else {
        status += "**Status**: No review CLIs available. Please install at least one to use reviews.\n";
      }
    
      return {
        content: [
          {
            type: "text",
            text: status,
          },
        ],
      };
    }
  • src/index.ts:178-186 (registration)
    Registers the 'check_cli_status' tool in the tools list returned by ListToolsRequestSchema, including name, description, and input schema.
    {
      name: "check_cli_status",
      description:
        "Check which code review CLIs (Codex/OpenAI and Gemini) are installed and available. Use this before requesting reviews to see what's available.",
      inputSchema: {
        type: "object",
        properties: {},
      },
    },
  • src/index.ts:105-106 (registration)
    Dispatches calls to the 'check_cli_status' handler in the CallToolRequestSchema request handler switch statement.
    case "check_cli_status":
      return await this.handleCheckCLIStatus();
  • Helper function called by the handler to detect and set the availability of Codex/OpenAI and Gemini CLI tools.
    private async detectCLIs() {
      console.error("Detecting available CLI tools...");
    
      // Check Codex CLI (codex-cli or openai)
      try {
        const { stdout } = await execAsync("codex --version", { timeout: 5000 });
        if (stdout.includes("codex-cli")) {
          this.cliAvailability.codex = true;
          console.error("✓ Codex CLI detected");
        }
      } catch (error) {
        // Try OpenAI CLI as fallback
        try {
          await execAsync("openai --version", { timeout: 5000 });
          this.cliAvailability.codex = true;
          console.error("✓ OpenAI CLI detected");
        } catch (error2) {
          this.cliAvailability.codex = false;
          console.error("✗ Codex/OpenAI CLI not found");
        }
      }
    
      // Check Gemini CLI
      try {
        await execAsync("gemini --version 2>/dev/null || gemini --help", { timeout: 5000 });
        this.cliAvailability.gemini = true;
        console.error("✓ Gemini CLI detected");
      } catch (error) {
        this.cliAvailability.gemini = false;
        console.error("✗ Gemini CLI not found");
      }
    
      this.cliAvailability.checked = true;
    
      if (!this.cliAvailability.codex && !this.cliAvailability.gemini) {
        console.error("⚠️  Warning: No review CLIs detected. Install OpenAI CLI and/or Gemini CLI to enable reviews.");
      }
    }
  • Defines the input schema for the 'check_cli_status' tool: an empty object (no parameters required).
    inputSchema: {
      type: "object",
      properties: {},
    },
Behavior3/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 clearly indicates this is a read-only check operation without side effects, but doesn't specify what format the availability information will be returned in, whether there are authentication requirements, or what happens if no CLIs are found. The description adds basic behavioral context but lacks detail about the output format.

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 perfectly concise with two focused sentences. The first sentence states the purpose, the second provides usage guidance. Every word earns its place, and the information is front-loaded with the core functionality stated immediately.

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 zero-parameter tool with no annotations and no output schema, the description provides good context about what the tool does and when to use it. However, it doesn't describe the return format or what specific information will be provided about CLI availability, leaving some ambiguity about the tool's output.

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

Parameters4/5

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

The tool has zero parameters with 100% schema description coverage, so the baseline is 4. The description appropriately doesn't discuss parameters since none exist, focusing instead on the tool's purpose and usage context.

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

Purpose5/5

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

The description clearly states the specific action ('Check which code review CLIs are installed and available') and identifies the resources (Codex/OpenAI and Gemini CLIs). It distinguishes this tool from its siblings (review_code, review_directory, review_file) by focusing on CLI availability checking rather than performing reviews.

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

Usage Guidelines5/5

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

The description provides explicit usage guidance: 'Use this before requesting reviews to see what's available.' This clearly indicates when to use this tool (as a prerequisite check) versus when to use its sibling review tools, establishing a clear workflow relationship.

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/je4550/review-mcp'

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