Skip to main content
Glama

generate_stylus_code

Generate Stylus/Rust smart contract code for Arbitrum using RAG context and version-aware generation. Supports ERC standards and custom contracts with optional tests.

Instructions

Generate Stylus/Rust smart contract code based on requirements. Uses RAG context to provide relevant examples. Supports version-aware generation for different stylus-sdk versions.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
promptYesDescription of the code to generate
context_queryNoOptional query to retrieve additional context
contract_typeNoType of contract to generate
include_testsNoWhether to include unit tests (default: false)
temperatureNoGeneration temperature 0-1 (default: 0.2)
target_versionNoTarget stylus-sdk version (default: 0.10.0). Use this to generate code for a specific SDK version.0.10.0
cargo_tomlNoOptional Cargo.toml content for automatic SDK version detection. If provided, target_version is auto-detected from dependencies.
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions using RAG context and version-aware generation, but doesn't cover important aspects like whether this is a read-only operation, what permissions are required, rate limits, error handling, or what the output format looks like. For a code generation tool with 7 parameters, this leaves significant gaps.

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 efficiently structured in two sentences that cover the core functionality, context mechanism, and version support. Every phrase adds value, though it could be slightly more front-loaded by leading with the primary purpose before mentioning implementation details.

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

Completeness2/5

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

For a code generation tool with 7 parameters, no annotations, and no output schema, the description is insufficient. It doesn't explain what the tool returns (code snippets? full files? error formats?), doesn't mention authentication requirements, and provides no guidance on error conditions or limitations. The description assumes too much about what users already know.

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 the schema already documents all 7 parameters thoroughly. The description adds minimal value beyond the schema - it mentions 'version-aware generation' which relates to target_version, and 'RAG context' which relates to context_query, but doesn't provide additional semantic context about how parameters interact or affect generation quality.

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 states the tool generates Stylus/Rust smart contract code based on requirements, specifies it uses RAG context for examples, and mentions version-aware generation. It distinguishes itself from siblings like generate_frontend or generate_tests by focusing specifically on smart contract code, though it doesn't explicitly contrast with generate_bridge_code or other code generation tools.

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 provides no guidance on when to use this tool versus alternatives like generate_bridge_code or generate_oracle. It mentions using RAG context and version-aware generation, but doesn't specify scenarios where this tool is preferred over other code generation tools or when it should be avoided.

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/Quantum3-Labs/ARBuilder'

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