Skip to main content
Glama

generate_csharp_script

Convert an existing Word document into a runnable C# script that reproduces the file. Use it to inspect document structure or as a starting point for editing via Kookerella.CsWordDsl.

Instructions

Reads an existing Word document and returns a self-contained C# file (using Kookerella.CsWordDsl) that rebuilds an equivalent file when run via dotnet run <file>.cs (.NET 10's file-based apps feature - no .csproj needed). The C# equivalent of generate_fsharp_script, for a caller who wants pasteable/ runnable C# rather than F# - useful for explaining how a file is structured, or as a starting point for the wrapper's fluent API (named styles, tables, images, headers/footers, comments, track changes, content controls, protection, etc. - Kookerella.CsWordDsl covers the same feature set as generate_fsharp_script's own Kookerella.FsWordDsl) beyond what create_document exposes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesPath to an existing .docx/.docm file to reverse-engineer into C# source.
outputFileNameYesThe output filename the generated script should save its rebuilt file to, e.g. "output.docx".

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observedv0.1.0

TDQS

A4.3/5.0
Behavior4/5

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

With no annotations provided, the description carries the burden of disclosing behavior. It clearly states that the tool reads an existing document and returns generated C# code, and adds useful context about the DSL, .NET 10 file-based apps, and no-.csproj requirement. It does not discuss edge cases, errors, or whether the input document remains untouched, but the core behavior is transparent enough for a safe read-and-generate operation.

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 main action is front-loaded and the description provides rich context, but the second sentence is quite long with several parentheticals and slightly repetitive DSL comparison. Still, nearly every piece of information earns its place by helping the agent understand the tool's output and relationship to siblings.

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 there is no output schema, the description does well to explain what the returned artifact is, how it is meant to be executed, and what feature areas it covers. It could be more complete about return format or failure behavior, but for a generation tool with fully documented parameters, it is sufficiently complete.

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 both parameters are already documented in the schema. The description does not add any parameter-specific guidance beyond what the schema provides, so the baseline score of 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 states a specific operation: reads an existing Word document and returns a self-contained C# file that rebuilds an equivalent document. It also explicitly contrasts itself with generate_fsharp_script and create_document, making its role distinct from sibling tools.

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?

It explicitly identifies generate_fsharp_script as the alternative and gives the selection criterion: C# vs F#. It also explains when the tool is useful (explaining file structure, as a starting point for fluent API) and notes it goes beyond what create_document exposes, giving an agent clear guidance on when to choose it.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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/Kookerella-Ltd/Kookerella.FsWordDsl'

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