Skip to main content
Glama

codeReview

Analyze code to identify bugs, security vulnerabilities, and deviations from established best practices.

Instructions

Review code for bugs, security issues, and best practices

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesThe code to review

Implementation Reference

  • The handler function that executes the 'codeReview' tool logic. It currently returns a placeholder response indicating that actual code review is handled via LLM prompts.
    async ({ code }) => { try { // In a real implementation, this would call an LLM to review the code // For now, we'll just return a placeholder message return { content: [{ type: "text", text: "Code review functionality will be handled by the LLM through prompts." }] }; } catch (error) { return { content: [{ type: "text", text: error instanceof Error ? error.message : String(error) }], isError: true }; } }
  • The registration of the 'codeReview' tool using server.tool(), including name, description, schema, and handler.
    server.tool( "codeReview", "Review code for bugs, security issues, and best practices", { code: z.string().describe("The code to review") }, async ({ code }) => { try { // In a real implementation, this would call an LLM to review the code // For now, we'll just return a placeholder message return { content: [{ type: "text", text: "Code review functionality will be handled by the LLM through prompts." }] }; } catch (error) { return { content: [{ type: "text", text: error instanceof Error ? error.message : String(error) }], isError: true }; } } );
  • Input schema for the 'codeReview' tool, defining the 'code' parameter.
    { code: z.string().describe("The code to review") },
  • Supporting prompt template for code review, which provides the LLM instructions for reviewing code, as referenced by the tool handler.
    server.prompt( "codeReview", "Prompt for reviewing code", { code: z.string().describe("The code to review") }, ({ code }) => ({ messages: [ { role: "user", content: { type: "text", text: `SYSTEM: You are a code review assistant. Please review the provided code for: 1. Bugs and logical errors 2. Security vulnerabilities 3. Performance issues 4. Code style and best practices 5. Potential improvements Be specific and provide actionable feedback.` } }, { role: "user", content: { type: "text", text: `Please review this code:\n\n${code}` } } ] }) );

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/auchenberg/claude-code-mcp'

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