Skip to main content
Glama
Platano78

Smart-AI-Bridge

generate_file

Generate fresh code files from a natural-language spec. Supports AI review, context files for consistent style, and optional unit test generation.

Instructions

Generate a new file from a natural-language spec. The local LLM writes the code; Claude either reviews the proposed content (review:true, default) or it gets written directly to outputPath (review:false). Use for fresh files you can describe by goal — boilerplate, scaffolding, test fixtures, single-file utilities. For editing an EXISTING file, use modify_file. For writing a known content string to disk with no LLM involved, use write_files_atomic. Optionally pass contextFiles to anchor the generated style on existing code. ⚠️ DESTRUCTIVE when review:false: writes (and creates parent directories of) outputPath. If includeTests:true, also writes a sibling test file. The default (review:true) is non-destructive — returns the generated content for Claude to inspect first. Returns: {success, status:'written'|'written_truncated'|'pending_review', outputPath, summary, linesOfCode, language, testPath (when includeTests), backend_used, processing_time, retry_attempts, was_truncated}. In review mode the response also carries the generated content for Claude to apply via write_files_atomic.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
specYesNatural language specification for the code to generate
outputPathYesWhere to write the generated file
optionsNo
Behavior5/5

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

No annotations exist, so the description fully covers behavioral traits. It warns 'DESTRUCTIVE when review:false' and explains the write behavior. It details both review modes (default non-destructive, destructive on direct write) and describes the return object fields. This exceeds expectations for 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 comprehensive but well-structured: purpose first, then usage, then conditional behaviors, then return details. Every sentence earns its place, though it is a bit long. Minor redundancy in explaining review modes could be trimmed.

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

Completeness5/5

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

Given the tool's complexity (two modes, nested options, multiple return fields, side effects), the description covers everything needed: input, behavior, alternatives, and return schema. The lack of an output schema is compensated by listing return fields. Complete for agent decision-making.

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?

Schema coverage is 67%, and the description adds meaning beyond schema: it explains how `spec` is a goal description, how `review` controls write vs. preview, and that `contextFiles` anchors style. It also clarifies the effect of `includeTests`. This adds value but is slightly duplicative of schema descriptions for some fields.

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 starts with 'Generate a new file from a natural-language spec,' clearly stating the verb and resource. It explicitly contrasts with sibling tools modify_file (editing) and write_files_atomic (direct write), making the purpose distinct.

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 explicitly states 'Use for fresh files you can describe by goal' and provides clear alternatives: 'For editing an EXISTING file, use modify_file. For writing a known content string to disk with no LLM involved, use write_files_atomic.' This gives the agent precise when-to-use guidance.

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/Platano78/Smart-AI-Bridge'

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