Appearance
add-agent-integration
This skill exposes a PPTB tool to AI assistants through the toolbox's built-in MCP server. It configures the agents layer in pptb.config.json on top of the tool's existing (or newly added) invocation contract, and — when the tool should run without a UI — scaffolds an invokeHeadless(input, context) entry point so an agent can drive the tool without opening its window.
Agent integration is three steps: declare an invocation contract, mark the tool as invokable by agents, and — if you want automated (non-UI) execution — add a headless runtime entry point.
When to use it
- "Make this tool callable by Claude/an AI assistant through MCP."
- "Add headless execution so an agent can run this tool without opening the UI."
- "Expose this tool for automated, one-way agent calls."
- "My tool already supports inter-tool invocation — now let agents call it too."
- After
add-inter-tool-invocation, since the agents layer sits on top of the same invocation contract.
Inputs
- Whether the tool should be agent-discoverable at all (
agents.invokable). - Which execution modes to support:
"windowed"(PPTB opens the tool's UI) and/or"headless"(PPTB runs the tool without a UI). - Whether calls are
"one-way"(fire-and-forget) or"two-way"(result-returning), and atimeoutMShint for the latter. - The location of the headless entry point, if not left to the default resolution order.
- Whether an
invocationcontract (prefill/returnTopic) already exists on the tool, or needs to be added first.
What it does
- Adds (or confirms) the
invocationobject inpptb.config.json— the same contract layer used by inter-tool invocation — describing the input payload and structured result. - Adds an
agentsobject topptb.config.jsonwithinvokable: true(only when the tool is meant to be agent-discoverable),modes("one-way"and/or"two-way"),executionModes(the actual supported modes), andtimeoutMSfor result-returning calls. - If headless execution is requested, scaffolds and exports an
invokeHeadless(input, context)function, and setsagents.headlessEntryto point at it. - Confirms the headless entry point is resolvable in PPTB's lookup order:
agents.headlessEntryfirst, thendist/headless.js, thenheadless.js, thenpackage.json'smainfield. - Aligns input/output shapes between the windowed (UI) path and the headless path so an agent and a human get equivalent results from equivalent input.
- Adds progress updates and structured logging in the headless path so an agent (and a human debugging it) can follow execution.
- Checks that no secrets appear in logs or in the headless input/output payloads.
- Prompts the pre-publish validation sequence: validate configuration locally, confirm MCP discovery shows the tool where expected, test both call modes, verify the headless payload matches the declared
returnTopic, and exercise the tool with the MCP Inspector.
Example
pptb.config.json additions:
json
{
"invocation": {
"version": "1.0.0",
"prefill": { "entityName": "string" },
"returnTopic": { "recordCount": "number", "records": "array" }
},
"agents": {
"invokable": true,
"modes": ["two-way"],
"executionModes": ["windowed", "headless"],
"headlessEntry": "dist/headless.js",
"timeoutMS": 15000
}
}Headless entry point:
javascript
// dist/headless.js
export async function invokeHeadless(input, context) {
const { entityName } = input;
context.log(`Querying ${entityName}...`);
const records = await context.dataverseAPI.retrieveMultiple(entityName);
return { recordCount: records.length, records };
}Checklist it enforces
- [ ]
pptb.config.jsondeclares both aninvocationobject and anagentsobject. - [ ]
agents.invokableis set intentionally —trueonly for tools meant to be agent-discoverable. - [ ]
agents.executionModesaccurately lists the modes the tool actually supports. - [ ] If headless execution is supported,
invokeHeadless(input, context)is exported and resolvable viaheadlessEntry,dist/headless.js,headless.js, orpackage.json.main(in that order). - [ ] Input/output shapes are identical (or documented as equivalent) across windowed and headless execution.
- [ ] No secrets appear in logs or payloads.
- [ ] The tool has been tested with the MCP Inspector before publishing.
Related
- Agent Integration — the reference this skill is built on
- add-inter-tool-invocation — supplies the shared
invocationcontract layer - publish-pptb-tool — run after agent integration is validated, before publishing