-
Notifications
You must be signed in to change notification settings - Fork 16
mcp_template_doc
Use this template to create one wiki page per DynamicsCrm.DevKit MCP tool.
File naming rule:
mcp_<exact_tool_name>.md
Examples:
mcp_whoami.md
mcp_manage_ribbon.md
The <exact_tool_name> value must come from the MCP tool metadata, not from the C# class name.
The source of truth for tool documentation is the real MCP server metadata returned by tools/list from the running server.
Do not manually rewrite, summarize, or reconstruct the tool description from source code when generating docs. Source code can be used to locate the implementation file, category, behavior notes, and examples, but the final "MCP Tool Description (Exact)" section must copy tool.description exactly from tools/list.
Preferred extraction order:
- Run the current DevKit MCP server with all tools loaded.
- Call MCP
tools/listagainst that running server. - Call MCP
resources/listandresources/templates/listagainst that running server. - Save the full
tools/list,resources/list, andresources/templates/listresponses as local JSON artifacts for verification. - Generate each documentation file from those JSON files.
- Use source files only to verify category, implementation path, output shape, warnings, examples, resource relationships, and edge cases.
If the AI environment already exposes the DevKit MCP tools directly, the active tool definitions can be used as the real MCP metadata only when they are known to be loaded from the same current build. Otherwise, run the server and call tools/list.
If tools/list cannot be obtained, stop and ask before generating the 33 tool docs.
If a tool references MCP resources, the resource metadata must come from resources/list or resources/templates/list from the same running server. Do not invent resource names from source code alone.
For the current v5 MCP server, --category advanced or default all should expose 33 tools.
Before writing tool docs, verify:
devkit mcp --toolsThen verify the exported tools/list JSON contains exactly 33 tool objects:
$json = Get-Content -Raw .\tools-list.json | ConvertFrom-Json
$json.tools.CountDo not create the final set unless the count is exactly 33, unless the user explicitly confirms that the tool count changed.
For each tool:
- Use
tool.nameas the exact tool name. - Use
tool.titleas the exact MCP title when present. - Use
tool.descriptionas the exact tool description. - Preserve punctuation, capitalization, line breaks, bullet spacing, and Unicode characters from
tool.description. - Do not fix grammar, normalize dashes/arrows, wrap text manually, or translate the description.
- If
tool.descriptionis missing or empty intools/list, write exactly:
(No description returned by tools/list.)
- Parameter descriptions must come from
tool.inputSchema.properties.<parameter>.descriptionexactly. - Required parameters must come from
tool.inputSchema.required. - Default values must come from the schema when present. If the schema does not include a default, write
-.
Some tools rely on MCP resources such as docs://... instruction documents or schema://... schemas.
For each generated tool page:
- Call
resources/listandresources/templates/liston the same running MCP server used fortools/list. - Preserve each resource's exact
name,title,urioruriTemplate,mimeType, anddescriptionfrom the MCP metadata. - Identify related resources by matching resource URIs or names mentioned in:
tool.description- parameter descriptions
- implementation source comments or constants
- user-facing guidance in resource descriptions
- A resource is related only when the tool should read it before or while using that tool. Do not list every resource on every tool page.
- If the relation is inferred from source code rather than directly mentioned in
tool.description, writeInferred from sourcein the reason column. - Do not paste full resource contents into every tool page unless the user explicitly asks. Link/list the resource metadata and summarize when to read it.
- If the tool has no related resources, write exactly:
This tool does not require any MCP resources.
Current resource source files for cross-checking:
DynamicsCrm.DevKit.Cli/Mcp/Resources/InstructionResources.cs
DynamicsCrm.DevKit.Cli/Mcp/Resources/SchemaResources.cs
Known current resource URI patterns:
docs://...
schema://...
Each tool page must include an estimated token count for that tool.
Count this payload:
The single minified JSON object for this tool as returned by tools/list.
Include at least these fields if they exist:
{
"name": "...",
"title": "...",
"description": "...",
"inputSchema": {}
}Do not count the whole wiki page. Do not count the entire tools/list response. Count only the one tool metadata object.
Do not include resource bodies in the tool token count. If resource token counts are needed later, document them separately as resource token counts, not as the tool token count.
Preferred tokenizer:
o200k_base
Example Python counting script:
import json
from pathlib import Path
import tiktoken
tools = json.loads(Path("tools-list.json").read_text(encoding="utf-8"))["tools"]
tool = next(t for t in tools if t["name"] == "whoami")
payload = json.dumps(tool, ensure_ascii=False, separators=(",", ":"))
encoding = tiktoken.get_encoding("o200k_base")
print(len(encoding.encode(payload)))If tiktoken is not available, use an approximation and label it as approximate:
$json = Get-Content -Raw .\tools-list.json | ConvertFrom-Json
$tool = $json.tools | Where-Object name -eq 'whoami'
$payload = $tool | ConvertTo-Json -Depth 100 -Compress
[math]::Ceiling($payload.Length / 4)Document the method in the page:
Estimated token count: ~123 tokens (tools/list tool JSON, o200k_base, measured 2026-06-18)
or:
Estimated token count: ~123 tokens (tools/list tool JSON, char_count/4 fallback, measured 2026-06-18)
Use these files to cross-check implementation details:
DynamicsCrm.DevKit.Cli/Mcp/McpServerHost.cs
DynamicsCrm.DevKit.Cli/Mcp/Tools/<ToolClass>.cs
DynamicsCrm.DevKit.Cli/Mcp/Tools/Models/*.cs
DynamicsCrm.DevKit.Cli/Mcp/Tools/Helper/*.cs
DynamicsCrm.DevKit.Cli/Mcp/Resources/*.cs
McpServerHost.ToolCategoryMap determines category:
basic
standard
advanced
The tool implementation class has [McpServerToolType]. The public tool method has [McpServerTool(Name = "...")].
Use source code to verify:
- Category.
- Implementation file.
- Safety warnings.
- Mutating vs read-only behavior.
- Output model name and notable structured fields.
- Related MCP resources.
- Practical examples.
Do not use source code as the final description source unless the user explicitly approves a fallback.
Copy this skeleton into each generated mcp_<tool_name>.md file and replace every placeholder.
## Summary
| Field | Value |
|---|---|
| Tool name | `<tool.name>` |
| MCP title | `<tool.title or "-">` |
| Category | `<basic/standard/advanced>` |
| Implementation | `<relative/source/path.cs>` |
| Estimated token count | `~<N> tokens (<method>, measured <YYYY-MM-DD>)` |
| Last verified | `<YYYY-MM-DD>` |
## MCP Tool Description (Exact)
```text
<copy tool.description exactly from tools/list>
```
## Parameters
| Name | Type | Required | Default | Description |
|---|---|:---:|---|---|
| `<param>` | `<schema type>` | `<Yes/No>` | `<default or "-">` | `<exact parameter description from tools/list>` |
If the tool has no parameters, write:
```text
This tool has no input parameters.
```
## Input Schema
```json
<formatted tool.inputSchema copied from tools/list without changing values>
```
## Related MCP Resources
| Resource | URI / URI template | MIME type | Reason |
|---|---|---|---|
| `<resource.name>` | `<resource.uri or resource.uriTemplate>` | `<resource.mimeType>` | `<why this tool should read it>` |
If the tool has no related resources, write:
```text
This tool does not require any MCP resources.
```
## When To Use
- <Practical use case from the exact description and implementation behavior.>
- <Add only useful, user-facing guidance.>
## Notes
- <Safety behavior, destructive behavior, auth requirements, limits, paging, fuzzy matching, or publish behavior.>
- <Use source code for this section when needed.>
## Example
```json
{
"<parameter>": "<value>"
}
```
## Output
Describe the normal output shape in concise terms. Mention important structured result fields when the implementation returns a named result model.
## Prompt Examples
- "Show me how to use `<tool.name>` to <practical scenario>."
- "Use `<tool.name>` to <practical scenario>."
- "Check <target> with `<tool.name>` and summarize what I should do next."Before finishing the 33 generated tool docs:
- Confirm
DynamicsCrm.DevKit.Wiki/mcpcontainsmcp_template_doc.md. - Confirm exactly 33 generated docs exist besides the template:
Get-ChildItem .\DynamicsCrm.DevKit.Wiki\mcp\mcp_*.md |
Where-Object Name -ne 'mcp_template_doc.md' |
Measure-Object- Confirm every generated filename is
mcp_<tool.name>.md. - Confirm every page has an "MCP Tool Description (Exact)" section copied from
tools/list. - Confirm every page has an estimated token count and records the counting method.
- Confirm no generated page uses paraphrased descriptions in the exact description section.
- Confirm source paths and categories match
McpServerHost.ToolCategoryMap. - Confirm every page has a "Related MCP Resources" section.
- Confirm listed resources exist in
resources/listorresources/templates/listfrom the same server run. - Confirm every generated page has a "Prompt Examples" section with at least three practical English prompts.
- Confirm resource contents are not copied wholesale into tool pages unless explicitly requested.
If future MCP metadata changes, update this template first when the documentation structure or extraction method needs to change. Do not silently generate docs with a different structure.