mcp-patterns
Load MCP development patterns and best practices for building tools with the @umbraco-cms/mcp-server-sdk. Use when starting tool development or needing pattern reference.
What this skill does
# MCP Development Patterns
This skill loads comprehensive patterns for building MCP tools using the `@umbraco-cms/mcp-server-sdk`.
## When to Use
Use this skill when:
- Starting to create new MCP tools
- Needing a reference for tool patterns
- Understanding how to use the toolkit helpers
- Setting up a new MCP server project
## Core Architecture
### Tool Definition Pattern
All tools follow this structure:
```typescript
import {
withStandardDecorators,
executeGetApiCall,
executeVoidApiCall,
createToolResult,
CAPTURE_RAW_HTTP_RESPONSE,
ToolDefinition,
} from "@umbraco-cms/mcp-server-sdk";
const MyTool = {
name: "tool-name",
description: "What the tool does",
inputSchema: zodSchema.shape,
outputSchema: responseSchema, // For GET operations
slices: ["read"], // Categorization
annotations: {
readOnlyHint: true, // For GET
destructiveHint: true, // For DELETE
idempotentHint: true, // For PUT
},
handler: async (params) => {
// Implementation
},
} satisfies ToolDefinition<...>;
export default withStandardDecorators(MyTool);
```
### API Client Configuration
Configure once at server startup:
```typescript
import { configureApiClient } from "@umbraco-cms/mcp-server-sdk";
import { getMyAPI } from "./api/generated/myApi.js";
configureApiClient(() => getMyAPI());
```
## Helper Functions
### executeGetApiCall
For GET operations that return data:
```typescript
return executeGetApiCall<ReturnType<Client["method"]>, Client>(
(client) => client.method(params, CAPTURE_RAW_HTTP_RESPONSE)
);
```
### executeVoidApiCall
For DELETE/PUT operations that return void:
```typescript
return executeVoidApiCall<Client>(
(client) => client.deleteItem(id, CAPTURE_RAW_HTTP_RESPONSE)
);
```
### createToolResult / createToolResultError
For custom responses (typically CREATE operations):
```typescript
if (response.status === 201) {
return createToolResult({ success: true, id: extractedId });
} else {
return createToolResultError(response.data);
}
```
## Slices (Tool Categorization)
Tools are categorized by operation type:
- `read` - GET operations
- `create` - POST create operations
- `update` - PUT operations
- `delete` - DELETE operations
- `search` - Search/filter operations
## Annotations Reference
| Operation | readOnlyHint | destructiveHint | idempotentHint |
|-----------|--------------|-----------------|----------------|
| GET | ✅ | ❌ | ❌ |
| DELETE | ❌ | ✅ | ❌ |
| POST | ❌ | ❌ | ❌ |
| PUT | ❌ | ❌ | ✅ |
**Important**: DELETE is NOT idempotent (2nd call returns 404).
## Project Structure
```
src/
├── api/
│ ├── client.ts # API client with mock support
│ ├── openapi.yaml # OpenAPI spec
│ └── generated/ # Orval-generated client + Zod schemas
├── tools/
│ └── {entity}/
│ ├── get/
│ ├── post/
│ ├── put/
│ ├── delete/
│ └── index.ts # Collection export
└── index.ts # MCP server entry
```
## Orval Code Generation
Generate client and Zod schemas from OpenAPI:
```bash
npm run generate
```
Configuration in `orval.config.ts`:
- Generates TypeScript client (configurable via `client` option)
- Generates Zod schemas for validation
- Uses custom mutator for authentication
## Best Practices
1. **Use Zod schemas** from generated code for type safety
2. **Hide UUID generation** - create internally, don't expect LLM to provide
3. **Clear descriptions** - tools should be self-documenting
4. **Consistent naming** - follow `{action}-{entity}` pattern
5. **Error handling** - `withStandardDecorators` handles errors automatically
Related in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.