Skip to main content
Glama

roslyn:get_generated_code

Retrieve the source code generated by C# source generators for a specific project and file. Use this tool to inspect automatically generated code that isn't visible in your source files.

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 describes the tool as a read operation ('View'), which implies non-destructive behavior, but lacks details on permissions, error handling, or rate limits. The description adds some context about the output and prerequisite tool, but more behavioral traits would improve transparency.

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?

The description is well-structured and front-loaded with the core purpose, followed by usage example, output details, and prerequisite guidance. Every sentence adds value without redundancy, making it efficient and easy to scan for key information.

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 the tool's moderate complexity (2 parameters, no output schema, no annotations), the description is mostly complete: it explains what the tool does, how to use it, the output, and prerequisites. However, it lacks details on error cases or behavioral constraints, which could be beneficial for full 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 description coverage is 100%, so the schema already documents both parameters ('projectName' and 'generatedFileName') adequately. The description adds minimal value beyond the schema by implying these parameters are used to locate the generated file, but does not provide additional syntax or format details. Baseline score of 3 is appropriate given high schema coverage.

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 with specific verbs ('View the source code') and resource ('produced by a source generator'), and distinguishes it from sibling tools like 'get_source_generators' by specifying it retrieves actual code content rather than just listing generators. It explicitly names the sibling tool for discovery, enhancing differentiation.

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 provides explicit usage guidance: it includes a usage example with parameter values, states the output format ('Full source code of the generated file'), and directs users to use 'get_source_generators first to discover available generated files', clearly indicating prerequisites and sequencing with alternatives.

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