Skip to main content
Glama

roslyn:analyze_control_flow

Analyze branching and reachability in C# code regions to identify entry points, exit points, and return statements using Roslyn compiler analysis.

Instructions

Analyze branching and reachability in a code region.

Returns: entryPoints, exitPoints, returnStatements, endPointIsReachable.

USAGE: analyze_control_flow("path/to/file.cs", startLine=10, endLine=25)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filePathYesAbsolute path to source file
startLineYesStart line (0-based)
endLineYesEnd line (0-based)
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions the return values (entryPoints, exitPoints, etc.), which is helpful, but does not cover critical aspects like whether the tool requires a loaded solution, if it's read-only or has side effects, error handling, or performance considerations. For a tool with zero annotation coverage, this is insufficient.

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 highly concise and well-structured: it states the purpose in one sentence, lists return values clearly, and provides a usage example. Every sentence adds value without redundancy, making it easy for an agent to parse and understand quickly.

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

Completeness3/5

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

Given the complexity of control flow analysis and the lack of annotations and output schema, the description is moderately complete. It explains what the tool does and what it returns, but lacks details on behavioral traits (e.g., prerequisites, limitations) and does not fully compensate for the missing output schema, leaving the return structure ambiguous.

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?

The schema description coverage is 100%, so the schema already fully documents the parameters (filePath, startLine, endLine). The description adds a usage example that reinforces the parameter order and format, but does not provide additional semantic context beyond what the schema states. This meets the baseline for 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: 'Analyze branching and reachability in a code region.' It specifies the verb ('analyze'), the resource ('branching and reachability'), and the scope ('code region'), distinguishing it from siblings like 'analyze_data_flow' or 'analyze_method' by focusing on control flow rather than data dependencies or method-level analysis.

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. While it includes a usage example, it does not mention when this analysis is appropriate (e.g., for debugging, optimization) or when to prefer other tools like 'analyze_data_flow' or 'get_complexity_metrics'. This leaves the agent without context for tool selection.

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