Skip to main content
Glama

roslyn:get_generated_code

Retrieve the full source code of a file generated by a source generator for a specified .NET project. Use after discovering available generated files with get_source_generators.

Instructions

View the source code produced by a source generator.

USAGE: get_generated_code(projectName: "MyApp", generatedFileName: "MyType.g.cs")

OUTPUT: Full source code of the generated file. Use get_source_generators first to discover available generated files.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectNameYesProject containing the generated file
generatedFileNameYesName of the generated file
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It states the output is full source code, but does not explicitly mention that the operation is read-only or any side effects. The name 'get' implies read-only, but more transparency would be beneficial.

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 concise, front-loaded with the purpose, and includes a usage example and output hint in a structured format. Every sentence adds value without unnecessary repetition.

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?

Given two simple string parameters and no output schema, the description is fairly complete: it states purpose, usage, output, and prerequisite. It could mention that the generated file must exist, but that is implied. Lacking annotations, it still provides adequate context.

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 covers both parameters with descriptions (100% coverage). The description adds a usage example with parameter names, but does not enrich the meaning beyond what the schema already provides. Baseline 3 is appropriate.

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 tool's purpose: 'View the source code produced by a source generator.' It includes a usage example with concrete parameter values and specifies the output is full source code. This distinguishes it from sibling tools like get_source_generators.

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

Usage Guidelines4/5

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

The description explicitly advises to 'Use get_source_generators first to discover available generated files,' providing clear guidance on the prerequisite workflow. It doesn't list when not to use this tool, but the sibling differentiation is helpful.

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/pzalutski-pixel/sharplens-mcp'

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