add-data-source
Guide the user to add a data source, connection, or API connector to a Canvas App via Power Apps Studio, then verify and…
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
Claude Code
$ npx -y skills add microsoft/power-platform-skills --skill generate-codeful-mcp-tool --agent claude-code
Codex
$ npx skills add microsoft/power-platform-skills --skill generate-codeful-mcp-tool -a codex -y
Cursor
$ npx skills add microsoft/power-platform-skills --skill generate-codeful-mcp-tool -a cursor -y
Gemini CLI
$ npx skills add microsoft/power-platform-skills --skill generate-codeful-mcp-tool -a gemini-cli -y
GitHub Copilot
$ npx skills add microsoft/power-platform-skills --skill generate-codeful-mcp-tool -a github-copilot -y
OpenCode
$ npx skills add microsoft/power-platform-skills --skill generate-codeful-mcp-tool -a opencode -y
Windsurf
$ npx skills add microsoft/power-platform-skills --skill generate-codeful-mcp-tool -a windsurf -y
name: 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:**
---
You generate a matched pair of files for one MCP tool:
description, input schema, output schema, and MCP tool annotations.
The host imports the JavaScript module and calls:
await runTool({ toolInput, dataApi });Before generating, establish:
1. 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. 2. 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. 3. The expected result, preferably as a representative output object. 4. Whether it reads or writes Dataverse, the requested tables in business terms, and whether any write creates, appends, updates, overwrites, or deletes state. 5. 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.
Read:
${PLUGIN_ROOT}/references/codeful-tool-host-data-api.d.ts
${PLUGIN_ROOT}/samples/account-summary.tool.js
${PLUGIN_ROOT}/samples/account-summary.tool.jsonThe 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.
Skip this phase when the tool does not use Dataverse.
For a Dataverse-backed tool:
1. Confirm PAC CLI is authenticated to the intended environment. 2. Discover candidate tables:
pac model list-tables --search "table terms"
`--search` is 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. 3. 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"
4. Read `RuntimeTypes.ts`. Extract the registered tables, exact readable/writable logical columns, lookup shapes, choice names, and raw numeric choice values. 5. 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.
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 async function runTool({ toolInput, dataApi }) {
// complete implementation
}filesystem access, environment-variable access, or generated-type dependency.
escape values interpolated into OData filters.
`filter`, `orderBy`, and row objects.
`"<column>@OData.Community.Display.V1.FormattedValue"`.
`page.hasMoreRows` is true and the function exists.
emit raw Web API `@odata.bind` keys.
original error as the cause. Never return a success-shaped fallback after a failed read or write.
instances, or cyclic objects.
row contents, identifiers, or other user data in telemetry properties.
The JSON s
Plugins from Microsoft that teach AI assistants, such as GitHub Copilot and Claude Code, to build on Power Platform.
Guide the user to add a data source, connection, or API connector to a Canvas App via Power Apps Studio, then verify and…
Creates or edits a Power Apps Canvas App through the Canvas Authoring MCP coauthoring session. Handles staged experience design,…
Configure the Canvas Authoring MCP server for the current coauthoring session. Use before starting to edit a canvas app with the…
Use this skill when the user wants to "report a bug", "file an issue", "report an issue", "submit a bug report", or report any…
Adds Azure DevOps connector to a Power Apps code app. Use when querying work items, creating bugs, managing pipelines, or making…
Adds any Power Platform connector to a Power Apps code app. Generic fallback for connectors not covered by a specific skill.
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…
Ask which skill or flow fits your situation. A router over the skills in this repo.