Skip to main content
Glama

roslyn:encapsulate_field

Encapsulate a field into a property with getter and setter by positioning the cursor on the field declaration. Uses zero-based line and column coordinates.

Instructions

Convert a field to a property with getter/setter.

USAGE: Position cursor on a field declaration. OUTPUT: Generated property wrapping the field. IMPORTANT: Uses ZERO-BASED coordinates (editor line - 1).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filePathYesAbsolute path to source file
lineYesZero-based line number on the field
columnYesZero-based column number
previewNoPreview mode (default: true)
Behavior3/5

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

No annotations provided, so description carries full burden. It mentions conversion and output, but lacks details on whether the tool modifies the file in-place, what the return format is, or how preview mode affects behavior. The zero-based coordinate warning adds useful context.

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 extremely concise: three short sentences covering purpose, usage, output, and an important note. No unnecessary words, front-loaded with 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 simple refactoring with 4 parameters and no output schema, the description covers the core action and critical coordinate detail. However, it omits what the tool actually returns (e.g., a code action or modified code) and does not mention side effects or preview behavior, leaving minor gaps.

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 100% (baseline 3). The description adds the 'ZERO-BASED coordinates' emphasis, which is not fully captured in schema descriptions, providing extra value. However, it does not explain the 'preview' parameter or other semantics beyond coordinates.

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 'Convert a field to a property with getter/setter', which is a specific verb+resource. It distinguishes from sibling tools like 'rename_symbol' or 'extract_method'.

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?

Provides actionable usage: 'Position cursor on a field declaration' and a critical note about zero-based coordinates. However, it does not explicitly state when not to use this tool or compare with alternatives like 'change_signature'.

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