Data & AI
typespec-create-api-plugin - Claude MCP Skill
Generate a TypeSpec API plugin with REST operations, authentication, and Adaptive Cards for Microsoft 365 Copilot
SEO Guide: Enhance your AI agent with the typespec-create-api-plugin tool. This Model Context Protocol (MCP) server allows Claude Desktop and other LLMs to generate a typespec api plugin with rest operations, authentication, and adaptive cards for microsof... Download and configure this skill to unlock new capabilities for your AI workflow.
Documentation
SKILL.md# Create TypeSpec API Plugin
Create a complete TypeSpec API plugin for Microsoft 365 Copilot that integrates with external REST APIs.
## Requirements
Generate TypeSpec files with:
### main.tsp - Agent Definition
```typescript
import "@typespec/http";
import "@typespec/openapi3";
import "@microsoft/typespec-m365-copilot";
import "./actions.tsp";
using TypeSpec.Http;
using TypeSpec.M365.Copilot.Agents;
using TypeSpec.M365.Copilot.Actions;
@agent({
name: "[Agent Name]",
description: "[Description]"
})
@instructions("""
[Instructions for using the API operations]
""")
namespace [AgentName] {
// Reference operations from actions.tsp
op operation1 is [APINamespace].operationName;
}
```
### actions.tsp - API Operations
```typescript
import "@typespec/http";
import "@microsoft/typespec-m365-copilot";
using TypeSpec.Http;
using TypeSpec.M365.Copilot.Actions;
@service
@actions(#{
nameForHuman: "[API Display Name]",
descriptionForModel: "[Model description]",
descriptionForHuman: "[User description]"
})
@server("[API_BASE_URL]", "[API Name]")
@useAuth([AuthType]) // Optional
namespace [APINamespace] {
@route("[/path]")
@get
@action
op operationName(
@path param1: string,
@query param2?: string
): ResponseModel;
model ResponseModel {
// Response structure
}
}
```
## Authentication Options
Choose based on API requirements:
1. **No Authentication** (Public APIs)
```typescript
// No @useAuth decorator needed
```
2. **API Key**
```typescript
@useAuth(ApiKeyAuth<ApiKeyLocation.header, "X-API-Key">)
```
3. **OAuth2**
```typescript
@useAuth(OAuth2Auth<[{
type: OAuth2FlowType.authorizationCode;
authorizationUrl: "https://oauth.example.com/authorize";
tokenUrl: "https://oauth.example.com/token";
refreshUrl: "https://oauth.example.com/token";
scopes: ["read", "write"];
}]>)
```
4. **Registered Auth Reference**
```typescript
@useAuth(Auth)
@authReferenceId("registration-id-here")
model Auth is ApiKeyAuth<ApiKeyLocation.header, "X-API-Key">
```
## Function Capabilities
### Confirmation Dialog
```typescript
@capabilities(#{
confirmation: #{
type: "AdaptiveCard",
title: "Confirm Action",
body: """
Are you sure you want to perform this action?
* **Parameter**: {{ function.parameters.paramName }}
"""
}
})
```
### Adaptive Card Response
```typescript
@card(#{
dataPath: "$.items",
title: "$.title",
url: "$.link",
file: "cards/card.json"
})
```
### Reasoning & Response Instructions
```typescript
@reasoning("""
Consider user's context when calling this operation.
Prioritize recent items over older ones.
""")
@responding("""
Present results in a clear table format with columns: ID, Title, Status.
Include a summary count at the end.
""")
```
## Best Practices
1. **Operation Names**: Use clear, action-oriented names (listProjects, createTicket)
2. **Models**: Define TypeScript-like models for requests and responses
3. **HTTP Methods**: Use appropriate verbs (@get, @post, @patch, @delete)
4. **Paths**: Use RESTful path conventions with @route
5. **Parameters**: Use @path, @query, @header, @body appropriately
6. **Descriptions**: Provide clear descriptions for model understanding
7. **Confirmations**: Add for destructive operations (delete, update critical data)
8. **Cards**: Use for rich visual responses with multiple data items
## Workflow
Ask the user:
1. What is the API base URL and purpose?
2. What operations are needed (CRUD operations)?
3. What authentication method does the API use?
4. Should confirmations be required for any operations?
5. Do responses need Adaptive Cards?
Then generate:
- Complete `main.tsp` with agent definition
- Complete `actions.tsp` with API operations and models
- Optional `cards/card.json` if Adaptive Cards are neededSignals
Information
- Repository
- github/awesome-copilot
- Author
- github
- Last Sync
- 3/13/2026
- Repo Updated
- 3/13/2026
- Created
- 2/25/2026
Reviews (0)
No reviews yet. Be the first to review this skill!
Related Skills
upgrade-nodejs
Upgrading Bun's Self-Reported Node.js Version
cursorrules
CrewAI Development Rules
cn-check
Install and run the Continue CLI (`cn`) to execute AI agent checks on local code changes. Use when asked to "run checks", "lint with AI", "review my changes with cn", or set up Continue CI locally.
CLAUDE
CLAUDE.md
Related Guides
Bear Notes Claude Skill: Your AI-Powered Note-Taking Assistant
Learn how to use the bear-notes Claude skill. Complete guide with installation instructions and examples.
Mastering tmux with Claude: A Complete Guide to the tmux Claude Skill
Learn how to use the tmux Claude skill. Complete guide with installation instructions and examples.
OpenAI Whisper API Claude Skill: Complete Guide to AI-Powered Audio Transcription
Learn how to use the openai-whisper-api Claude skill. Complete guide with installation instructions and examples.