Skip to main content
Glama

grok_review_code

Reviews code snippets to detect bugs, security issues, performance problems, and readability improvements, with optional focus areas and language context.

Instructions

Have Grok review a code snippet for bugs, security issues, performance and readability.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "code": "<code>"
    },
    "name": "grok_review_code"
  }
}

Input Schema

NameRequiredDescriptionDefault
codeYesThe source code to review.
focusNoOptional focus such as "security" or "performance".
languageNoProgramming language, e.g. "typescript".

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.5/5.0
Behavior3/5

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

No annotations are supplied, so the description carries the full behavioral burden, and it does disclose the key trait that a delegated external model (Grok) performs the review. It says nothing about snippet size limits, latency/cost, determinism, or whether findings come back as structured items versus prose, which leaves the main operational unknowns unaddressed.

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?

A single front-loaded sentence with no filler; the scope of the review is stated immediately and nothing is repeated from the schema.

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

Completeness3/5

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

For a three-parameter tool with no annotations and, importantly, no output schema, the definition tells the agent how to invoke it but not what to expect back. Since no output schema exists to describe the return shape, a sentence on whether the response is prose or categorized findings would materially help.

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?

Schema description coverage is 100%, so all three parameters are already documented in the input schema, making 3 the baseline. The description adds only marginal semantic value by itemizing the review axes, which hints at valid values for the optional 'focus' parameter without giving format or example syntax.

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 gives a specific verb (review) and resource (a code snippet) and enumerates the review axes: bugs, security, performance, readability. That is enough to distinguish it from ask_grok and grok_summarize, though it never states the differentiation explicitly.

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

Usage Guidelines3/5

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

Usage is only implied: an agent can infer you call this when you have source code needing critique. There is no explicit when-to-use, when-not-to-use, or named alternative (e.g. grok_explain_error for diagnosing a specific failure), so the agent must reason about routing itself.

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