generate-codeful-mcp-tool
Generate a self-contained JavaScript server runtime and registration metadata for an MCP codeful tool
Install / Use
npx skills add microsoft/power-platform-skills --skill generate-codeful-mcp-toolInstalls into whichever agent you are using.
SKILL.md
Installable skill definition
Quality Score
Category
Development & EngineeringSupported Platforms
Our assessment of generate-codeful-mcp-tool
generate-codeful-mcp-tool scores 90/100 on our quality scale, 1435th of 4,620 Development & Engineering skills we index (top 32%).
Its SKILL.md is 12 KB long, well organised into 11 sections with 6 code examples: a thorough specification that gives an agent plenty to work with.
It has 919 GitHub stars, a meaningful sign that others use it.
Maintenance, license and trust
- The repository was last updated 11 days ago, so generate-codeful-mcp-tool is actively maintained.
- It is released under the MIT license, a permissive license that allows use, modification and commercial use with attribution.
- Its trust signals score 100/100, with no cautions. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
generate-codeful-mcp-tool compared with similar skills
All 4 of these similar skills score higher than generate-codeful-mcp-tool; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| generate-codeful-mcp-tool (this skill)by microsoft | 90 | 919 | 11d ago | SKILL.md |
| Agent-Reachby Panniantong | 100 | 91.6k | 20d ago | CLAUDE.md |
| headroomby headroomlabs-ai | 100 | 74.4k | today | CLAUDE.md |
| CowAgentby zhayujie | 100 | 47.2k | today | CLAUDE.md |
| ai-job-searchby MadsLorentzen | 100 | 45.0k | 2d ago | CLAUDE.md |
Frequently asked questions
- How do I install generate-codeful-mcp-tool?
- Run
npx skills add microsoft/power-platform-skills --skill generate-codeful-mcp-tool. The install tabs above show the steps for each supported agent. - Which AI agents does generate-codeful-mcp-tool work with?
- It is written for Universal, as a SKILL.md file. Other agents that read the same format can often use it too.
- Is generate-codeful-mcp-tool safe to use?
- It is MIT-licensed and scores 100/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is generate-codeful-mcp-tool still maintained?
- The repository was last updated 11 days ago, so generate-codeful-mcp-tool is actively maintained.
Skill content
View source on GitHubname: generate-codeful-mcp-tool version: 1.0.0 description: > Generate a self-contained JavaScript server runtime and registration metadata for an MCP codeful tool. Use when the user asks to create a codeful MCP tool, generate server logic for an MCP tool, write a runTool function, build a Dataverse-backed MCP tool, or pair MCP server logic with an MCP App widget. author: Microsoft Corporation argument-hint: <tool purpose, inputs, and expected result> user-invocable: true allowed-tools: Read, Write, Edit, Bash, Glob, Grep, AskUserQuestion, Skill
Triggers: codeful MCP tool, MCP server tool, generate runTool, MCP tool JavaScript, Dataverse MCP tool, server logic for MCP App
Keywords: mcp apps, codeful tool, runTool, dataApi, Dataverse, server runtime
Aliases: /generate-codeful-mcp-tool, /codeful-tool
References:
- Host API types: codeful-tool-host-data-api.d.ts
- Known-good tool: account-summary.tool.js
- Known-good metadata: account-summary.tool.json
- Widget generation: generate-mcp-app-ui
You generate a matched pair of files for one MCP tool:
<tool-name>.tool.js: the complete JavaScript server implementation.<tool-name>.tool.json: declarative registration metadata containing the tool name, description, input schema, output schema, and MCP tool annotations.
The host imports the JavaScript module and calls:
await runTool({ toolInput, dataApi });
Required information
Before generating, establish:
- The tool's purpose and kebab-case tool name. Use the purpose to write a concise, model-actionable tool description; ask only when the intended behavior is ambiguous.
- Its input fields, types, required fields, and constraints. Accept a JSON Schema, a representative input object, or an exact field description. Never guess the input shape.
- The expected result, preferably as a representative output object.
- Whether it reads or writes Dataverse, the requested tables in business terms, and whether any write creates, appends, updates, overwrites, or deletes state.
- Whether the user also wants an MCP App widget.
Ask only for information that is missing. A sample input/output is preferred but not mandatory when the user has supplied an equally precise contract.
Phase 1: Read the runtime and metadata contracts
Read:
${PLUGIN_ROOT}/references/codeful-tool-host-data-api.d.ts
${PLUGIN_ROOT}/samples/account-summary.tool.js
${PLUGIN_ROOT}/samples/account-summary.tool.json
The generated runtime is plain ESM JavaScript, and the sidecar is plain JSON. Type files are generation-time references only and MUST NOT be imported by the output.
Phase 2: Verify Dataverse schema when needed
Skip this phase when the tool does not use Dataverse.
For a Dataverse-backed tool:
-
Confirm PAC CLI is authenticated to the intended environment.
-
Discover candidate tables:
pac model list-tables --search "table terms"--searchis substring-based. Post-filter its output and accept a table only when its logical name exactly matches the selected result. If multiple tables remain plausible, ask the user to choose. -
Create a unique temporary directory outside the final output path and generate types:
pac model genpage generate-types --data-sources "logical1,logical2" --output-file "<temp>/RuntimeTypes.ts" -
Read
RuntimeTypes.ts. Extract the registered tables, exact readable/writable logical columns, lookup shapes, choice names, and raw numeric choice values. -
Use ONLY names and values verified in that file. Custom columns are unpredictable; do not derive them from display names.
If discovery or type generation fails, stop and report the error. Do not fall back to
invented tables or columns. Delete the temporary types and directory after validation so
the final output contains only the requested .tool.js, .tool.json, and optional
widget files.
Phase 3: Generate the paired tool artifacts
Write <tool-name>.tool.js and <tool-name>.tool.json in the user's working directory
unless they requested another output directory. Both files MUST use the same basename,
which MUST equal the confirmed kebab-case tool name.
The JavaScript file MUST:
-
Export exactly one MCP entry point named
runTool, preferably:export async function runTool({ toolInput, dataApi }) { // complete implementation } -
Be self-contained JavaScript with no runtime imports, packages, network calls, filesystem access, environment-variable access, or generated-type dependency.
-
Validate all externally supplied
toolInputbefore using it. Apply bounds to counts and escape values interpolated into OData filters. -
Use singular Dataverse entity logical names. Use exact logical column names in
select,filter,orderBy, and row objects. -
Read choice and lookup labels from
"<column>@OData.Community.Display.V1.FormattedValue". -
Access query rows through
page.rows. Followpage.loadMoreRows()only whilepage.hasMoreRowsis true and the function exists. -
Set lookups through the verified
_<field>_valueshape fromRuntimeTypes.ts; never emit raw Web API@odata.bindkeys. -
Let
dataApifailures throw. Catch only when adding useful context, and rethrow with the original error as the cause. Never return a success-shaped fallback after a failed read or write. -
Contain no placeholders, TODOs, ellipses, test credentials, or real environment IDs.
-
Return JSON-serializable values only. Never return
loadMoreRows, functions, class instances, or cyclic objects. -
Emit telemetry only when the user explicitly asks for it, and never include tool inputs, row contents, identifiers, or other user data in telemetry properties.
The JSON sidecar MUST be valid JSON with exactly these top-level fields:
{
"name": "account-summary",
"description": "Search accounts and return revenue and status summaries.",
"annotations": {
"readOnlyHint": true,
"destructiveHint": false,
"idempotentHint": true,
"openWorldHint": false
},
"inputSchema": {
"type": "object",
"properties": {}
},
"outputSchema": {
"type": "object",
"properties": {}
}
}
name: exactly the confirmed tool name and the shared file basename.description: concise, model-actionable guidance explaining what the tool does and when to call it. Do not copy the user's prompt verbatim or include implementation details.annotations: MCPToolAnnotationsdescribing the tool's behavior. Always emit all four boolean hints:readOnlyHint:trueonly when the tool cannot modify Dataverse or any other state.destructiveHint:truewhen the tool may delete, overwrite, or otherwise cause a destructive update. Set it tofalsefor read-only tools and non-destructive creates or additive writes.idempotentHint:truewhen repeated calls with the same valid input have no additional effect. Reads, deterministic calculations, and updates that set the same values are idempotent; creates and append-style operations are not.openWorldHint: alwaysfalsebecause the codeful runtime cannot access arbitrary external systems. Infer these values from the generated implementation and requested behavior. If the write semantics are genuinely ambiguous, ask before generating rather than guessing. Treat annotations as advisory metadata, not as a substitute for runtime validation or authorization.
inputSchema: the complete JSON Schema fortoolInput. Use an object root, list every accepted field underproperties, identify required fields withrequired, encode runtime constraints such as bounds, formats, enums, and array item shapes, and setadditionalProperties: falseunless the user explicitly requires extensible input.outputSchema: the JSON Schema for the model-visiblestructuredContentbusiness payload. For a plain-object return, describe the complete returned object because the host promotes it tostructuredContent. For an envelope return, describe only itsstructuredContentproperty. Never includecontent, authoredmeta, or runtime_metainoutputSchema.
Use standard JSON Schema keywords only. Do not include credentials, environment identifiers, Dataverse discovery artifacts, host configuration, JavaScript expressions, comments, or placeholders in the sidecar.
Result-channel contract
Choose the smallest correct result shape.
Simple structured result
Return a plain object when all useful output belongs in model-visible structured data:
return { records, totalCount: records.length };
The host promotes that object to MCP structuredContent.
Partitioned MCP result
Return an envelope when the channels have different audiences:
return {
content: `Found ${records.length} records.`,
structuredContent: { records },
meta: { preferredView: "table" },
};
content: model-visible conversational text, either a string or text content blocks.structuredContent: model-visible machine-readable object.meta: widget-only object. The host maps it to MCP_meta; widgets readresult._meta.
The names content, structuredContent, and meta are reserved envelope keys. If a
business payload naturally has any of those keys, wrap the whole payload explicitly:
return { structuredContent: businessPayload };
Do not mix envelope keys with unrelated top-level business fields.
Phase 4: Validate
Before reporting completion:
- Confirm exactly one final
.tool.jsand one matching.tool.jsonwere created for this skill. - Import the file as an ESM data URL with Node.js and assert that
runToolis a function. Importing MUST NOT execute data access or other top-level side effects. - Parse the sidecar with
JSON.parse. Confirm it has exactlyname,description,annotations,inputSchema, andoutputSchema; the name matches both filenames; all four annotation hints are booleans,openWorldHintisfalse, the other hints match the implementation's actual behavior, both schemas have object roots, and every input constraint enforced by the runtime is represented ininputSchema. - Grep the output for imports,
require, placeholders, guessed columns, and unsupported host access. - When representative input/output was supplied, invoke
runToolwith an in-memory mockdataApifrom an inline Node script. Do not create a persistent test file. - Confirm the returned value matches the requested result contract, contains no
functions or non-serializable values, and its structured payload conforms to
outputSchema. Confirm the representative input conforms toinputSchema. - Delete all temporary schema artifacts.
Optional MCP App handoff
When the user asks for a widget:
- Finish and validate the paired
.tool.jsand.tool.jsonfirst. - Build a representative result sample:
- Plain tool return -> treat it as
structuredContent. - Envelope return -> pass
content,structuredContent, and_meta(renamed from the authoredmetafield).
- Plain tool return -> treat it as
- Invoke
generate-mcp-app-uiwith the visual requirements, tool name, input sample, and representative full result. Forward an explicit CDN policy from the user's request. If none was supplied, let the UI skill ask its required CDN-policy question; do not assume public URLs are allowed. - Keep the outputs separate: one
.tool.js, one.tool.json, and one single-file.htmlusing the selected CDN policy.
Refinement
When editing an existing codeful tool, read
Truncated for display — read the full file on GitHub.
Related Skills
Agent-Reach
91.6kGive your AI agent eyes to see the entire internet. Read & search Twitter, Reddit, YouTube, GitHub, Bilibili, XiaoHongShu — one CLI, zero API fees.
headroom
74.4kCompress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.
CowAgent
47.2kOpen-source personal AI assistant & Agent Harness. Plans tasks, runs tools and skills, self-evolves with memory and knowledge. Multi-agent, multi-model, multi-channel. Lightweight, extensible, one-line install.
ai-job-search
45.0kThe job search that runs on your machine. AI job application framework built on Claude Code: evaluate postings, tailor CVs, write cover letters, prep interviews. Fork it and own it.
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
