feat: add tool examples#50
Conversation
There was a problem hiding this comment.
Pull request overview
Adds exportable example payloads to MCP tool definitions to support CLI/tooling consumers, and bumps the package version to reflect the new tool metadata.
Changes:
- Extend
MakeMCPToolwith an optionalexamplesfield for sample input payloads. - Populate
examplesacross most endpoint MCP tool definitions. - Bump npm package version from
1.1.2to1.2.0(and lockfile).
Reviewed changes
Copilot reviewed 25 out of 26 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/mcp.ts | Adds examples?: ... to the shared MCP tool type so examples can be exported/consumed. |
| src/endpoints/users.mcp.ts | Adds an empty-input example for the users “me” tool. |
| src/endpoints/teams.mcp.ts | Adds example payloads for team list/get/create/delete tools. |
| src/endpoints/sdk/webhooks.mcp.ts | Adds examples for SDK webhook list/get/create/update/delete/section tools. |
| src/endpoints/sdk/rpcs.mcp.ts | Adds examples for SDK RPC list/get/create/update/delete/test/section tools. |
| src/endpoints/sdk/modules.mcp.ts | Adds examples for SDK module list/get/create/update/delete/section tools. |
| src/endpoints/sdk/functions.mcp.ts | Adds examples for SDK function list/get/create/delete/code/test tools. |
| src/endpoints/sdk/connections.mcp.ts | Adds examples for SDK connection list/get/create/update/delete/section/common tools. |
| src/endpoints/sdk/apps.mcp.ts | Adds examples across SDK apps tools and updates the create schema required fields. |
| src/endpoints/scenarios.mcp.ts | Adds examples for scenario list/get/create/update/delete/activate/deactivate/run/interface tools. |
| src/endpoints/organizations.mcp.ts | Adds examples for org list/get/create/update/delete tools. |
| src/endpoints/keys.mcp.ts | Adds examples for key list/get/create/update/delete tools. |
| src/endpoints/incomplete-executions.mcp.ts | Adds examples for incomplete execution list/get tools. |
| src/endpoints/hooks.mcp.ts | Adds examples for hook list/get/create/update/delete tools. |
| src/endpoints/functions.mcp.ts | Adds examples for function list/get/create/update/delete/check tools. |
| src/endpoints/folders.mcp.ts | Adds examples for folder list/create/update/delete tools. |
| src/endpoints/executions.mcp.ts | Adds examples for execution list/get/detail/incomplete-execution tools. |
| src/endpoints/enums.mcp.ts | Adds empty-input examples for enums endpoints. |
| src/endpoints/devices.mcp.ts | Adds example payload for devices list tool. |
| src/endpoints/data-structures.mcp.ts | Adds examples for data structure list/get/create/update/delete tools. |
| src/endpoints/data-stores.mcp.ts | Adds examples for data store list/get/create/update/delete tools. |
| src/endpoints/data-store-records.mcp.ts | Adds examples for data store record list/create/update/replace/delete tools. |
| src/endpoints/credential-requests.mcp.ts | Adds examples across credential request tools. |
| src/endpoints/connections.mcp.ts | Adds examples and updates create schema fields/requirements for connections tools. |
| package.json | Bumps package version to 1.2.0. |
| package-lock.json | Updates lockfile version fields to 1.2.0. |
Comments suppressed due to low confidence (1)
src/endpoints/sdk/apps.mcp.ts:97
- In
sdk-apps_create, the JSON schema marksthemeandlanguageas required, but the SDK’sCreateSDKAppBodydefines both as optional (and the tool’sexecuteargs type also makes them optional). This mismatch can cause schema-based callers to think they must provide these fields. Update therequiredlist (or the arg types) so the tool contract matches the SDK/API.
},
private: { type: 'boolean', description: 'Whether the app is private' },
audience: { type: 'string', description: 'Audience setting for the app' },
},
required: ['name', 'label', 'theme', 'language', 'audience'],
},
examples: [
{
name: 'my-app',
label: 'My App',
description: 'A custom app',
theme: '#FF5733',
language: 'en',
audience: 'global',
},
],
execute: async (
make: Make,
args: {
name: string;
label: string;
description?: string;
theme?: string;
language?: string;
countries?: string[];
private?: boolean;
audience: string;
},
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -82,8 +86,9 @@ export const tools = [ | |||
| description: 'OAuth scopes', | |||
| }, | |||
| }, | |||
| required: ['name', 'accountName', 'accountType', 'teamId'], | |||
| required: ['name', 'accountName', 'teamId'], | |||
| }, | |||
| examples: [{ name: 'My Google Connection', accountName: 'google', teamId: 5 }], | |||
There was a problem hiding this comment.
connections_create inputSchema/typing doesn’t match the underlying Connections.create API: the endpoint type is CreateConnectionBody with { name, accountName, teamId, data?, scopes? } (no accountType), but the tool’s execute args still require accountType, and the schema exposes scope (singular) instead of scopes (plural). This makes the tool contract confusing and prevents callers from providing OAuth scopes in a way that can actually be forwarded. Align the tool schema + args type with CreateConnectionBody (drop accountType, rename scope to scopes or remove it if unsupported) and ensure the value is passed through correctly.
Add exportable examples of tool usage. Primary for use in CLI.