Readme
Using Create Standalone Tool
Create Standalone Tool
Use this skill for an MCP tool that is not tied to a skill. Do not assume the repository is identical to the template; inspect the chosen plugin and adapt while preserving these best practices.
Inputs
plugin: target plugin underplugins/.tool: MCP tool id in kebab-case.- Tool title, description, input schema, and behavior.
Best-practice placement
plugins/<plugin>/tools/<tool-kebab>/<toolCamel>.ts
The tool must be registered in the plugin MCP server entrypoint, usually plugins/<plugin>/mcp-server/index.ts or the current repo's equivalent tool-registration file.
Steps
- Inspect
plugins/<plugin>/package.json,tsconfig.json, and MCP entrypoint/registration files. Confirm the plugin exists. - Create the tool file under
tools/<tool-kebab>/. - Implement using
@variant/mcp-serverimports:import type { McpServer } from '@variant/mcp-server'; import { log } from '@variant/mcp-server'; import { z } from 'zod'; export function registerToolCamel(server: McpServer): void { server.registerTool( '<tool-kebab>', { title: '<Tool Title>', description: '<Tool description>', inputSchema: { param: z.string().describe('Input parameter'), }, }, async ({ param }) => { log('info', '<tool-kebab>: called', { param }); return { content: [{ type: 'text', text: param }] }; }, ); } - Register the tool in the plugin's MCP tool registration location. For an entrypoint using
definePluginTools, add:
and includeimport { registerToolCamel } from '../tools/<tool-kebab>/<toolCamel>.js';registerToolCamelin the tools array. - Return expected tool errors as:
return { content: [{ type: 'text', text: 'Error: explanation' }], isError: true }; - Typecheck the plugin using the current package name or filter convention. If package names follow the template:
pnpm --filter @variant/plugin-<plugin> run typecheck
Rules
- Standalone tools belong under
tools/, not under a skill. - Shared infrastructure imports come from
@variant/mcp-server, never relative shared paths. - Adapt file paths if the repo has intentionally moved registration, but preserve the standalone-tool concept.