skills/conversation-history/SKILL.md
# Conversation History ## Capability Manages multi-turn conversation context for voice agents, building structured history for MCP requests, handling context window limits, and maintaining coherent dialogue across turns with token-aware truncation. ## MCP Tools | Tool | Input Schema | Output | Rate Limit | |------|-------------|--------|------------| | `history.build` | `z.object({ sessionId: z.string(), maxTurns: z.number().optional() })` | `{ history: Array<{role: string, content: string}>
npx skillsauth add reaatech/voice-agent-kit skills/conversation-historyInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Manages multi-turn conversation context for voice agents, building structured history for MCP requests, handling context window limits, and maintaining coherent dialogue across turns with token-aware truncation.
| Tool | Input Schema | Output | Rate Limit |
|------|-------------|--------|------------|
| history.build | z.object({ sessionId: z.string(), maxTurns: z.number().optional() }) | { history: Array<{role: string, content: string}> } | 1000 RPM |
| history.append | z.object({ sessionId: z.string(), role: z.enum(['user', 'assistant']), content: z.string() }) | { appended: boolean, turnCount: number } | 1000 RPM |
| history.clear | z.object({ sessionId: z.string() }) | { cleared: boolean } | 100 RPM |
| history.getTurns | z.object({ sessionId: z.string(), limit: z.number().optional() }) | { turns: Turn[] } | 100 RPM |
{
"name": "history.build",
"arguments": {
"sessionId": "sess-abc123-def456",
"maxTurns": 10
}
}
{
"history": [
{ "role": "user", "content": "Hello, I need to book an appointment" },
{ "role": "assistant", "content": "I can help with that. When would you like to schedule it?" },
{ "role": "user", "content": "Tomorrow at 2pm if possible" },
{ "role": "assistant", "content": "I have 2pm available tomorrow. How long should the meeting be?" }
]
}
{
"name": "history.append",
"arguments": {
"sessionId": "sess-abc123-def456",
"role": "user",
"content": "30 minutes would be perfect"
}
}
{
"appended": true,
"turnCount": 9
}
{
"name": "history.append",
"arguments": {
"sessionId": "sess-abc123-def456",
"role": "assistant",
"content": "I've booked a 30-minute meeting for tomorrow at 2pm. You'll receive a confirmation email shortly."
}
}
{
"appended": true,
"turnCount": 10
}
{
"name": "history.getTurns",
"arguments": {
"sessionId": "sess-abc123-def456",
"limit": 5
}
}
{
"turns": [
{
"turnId": "turn-006",
"userUtterance": "Hello, I need to book an appointment",
"agentResponse": "I can help with that. When would you like to schedule it?",
"timestamp": "2026-04-15T23:00:00Z",
"latencyMs": 620
},
{
"turnId": "turn-007",
"userUtterance": "Tomorrow at 2pm if possible",
"agentResponse": "I have 2pm available tomorrow. How long should the meeting be?",
"timestamp": "2026-04-15T23:00:05Z",
"latencyMs": 580
}
]
}
| Failure | Cause | Recovery | |---------|-------|----------| | Session not found | Invalid sessionId | Return empty history or error | | Token limit exceeded | Context too long | Truncate oldest turns | | Invalid role | Role not 'user' or 'assistant' | Return validation error | | Storage error | Database unavailable | Use in-memory fallback |
interface HistoryConfig {
maxTurns: number; // Default: 20
maxTokens: number; // Default: 4000
truncateStrategy: 'oldest' | 'smart';
}
// When adding a new turn that would exceed limits
function truncateHistory(history: Turn[], config: HistoryConfig): Turn[] {
if (history.length <= config.maxTurns) {
return history;
}
// Keep most recent turns
return history.slice(-config.maxTurns);
}
// Truncate based on token count while preserving context
function smartTruncate(history: Turn[], maxTokens: number): Turn[] {
const result: Turn[] = [];
let tokenCount = 0;
// Iterate from most recent to oldest
for (const turn of history.slice().reverse()) {
const turnTokens = estimateTokens(turn);
if (tokenCount + turnTokens <= maxTokens) {
result.unshift(turn);
tokenCount += turnTokens;
} else {
break;
}
}
return result;
}
| Metric | Type | Description |
|--------|------|-------------|
| voice.history.turns | Histogram | Turns per session |
| voice.history.tokens | Histogram | Token usage |
| voice.history.truncated | Counter | Truncation events |
| voice.history.append | Counter | Append operations |
| Span | Attributes |
|------|------------|
| voice.history.build | session_id, turn_count, token_count |
| voice.history.append | session_id, role, content_length |
| voice.history.truncate | session_id, turns_removed, tokens_removed |
tools
# Twilio Media Streams ## Capability Handles Twilio Media Streams WebSocket connections for real-time bidirectional audio communication, parsing inbound messages, encoding outbound audio, and managing call lifecycle events. ## MCP Tools | Tool | Input Schema | Output | Rate Limit | |------|-------------|--------|------------| | `twilio.handleStart` | `z.object({ message: z.object({ event: z.literal('start'), callSid: z.string(), streamSid: z.string(), format: z.string(), tracks: z.array(z.st
tools
# TTS Provider Interface ## Capability Provides a unified interface for text-to-speech (TTS) providers, enabling streaming audio synthesis with first-byte latency tracking, voice selection, and output format conversion. ## MCP Tools | Tool | Input Schema | Output | Rate Limit | |------|-------------|--------|------------| | `tts.synthesize` | `z.object({ text: z.string(), config: z.object({ provider: z.string(), voice: z.string().optional(), speed: z.number().optional() }) })` | `{ chunks: A
tools
# Telephony Lifecycle ## Capability Manages the complete lifecycle of voice calls from TwiML webhook initiation through call completion, including call connect, transfer, conference, and disconnect handling with proper session cleanup. ## MCP Tools | Tool | Input Schema | Output | Rate Limit | |------|-------------|--------|------------| | `telephony.generateTwiML` | `z.object({ sessionId: z.string(), wsUrl: z.string().url() })` | `{ twiml: string }` | 100 RPM | | `telephony.handleConnect` |
tools
# STT Provider Interface ## Capability Provides a unified interface for speech-to-text (STT) providers, enabling real-time streaming transcription with interim results, endpoint detection, and automatic reconnection handling. ## MCP Tools | Tool | Input Schema | Output | Rate Limit | |------|-------------|--------|------------| | `stt.connect` | `z.object({ provider: z.enum(['deepgram', 'aws-transcribe', 'google-cloud']), config: z.object({ apiKey: z.string().optional(), sampleRate: z.number