Skip to main content
Glama
test-conditions.js1.11 kB
import { handleToolCall } from './dist/registry.js'; async function test() { console.log('=== STEP 1: Create Character ===\n'); let result = await handleToolCall('create_character', { name: 'Exhausted Fighter', class: 'Fighter', level: 5, stats: { str: 16, dex: 14, con: 14, int: 10, wis: 12, cha: 10 } }); console.log(result.content[0].text); // Extract character ID from the output const idMatch = result.content[0].text.match(/Character ID: ([a-f0-9-]+)/); const characterId = idMatch[1]; console.log(`\nCharacter ID: ${characterId}\n`); console.log('=== STEP 2: Add Exhaustion Level 4 ===\n'); result = await handleToolCall('manage_condition', { targetId: characterId, operation: 'add', condition: 'exhaustion', exhaustionLevels: 4, source: 'Forced march' }); console.log(result.content[0].text); console.log('\n=== STEP 3: Get Character (should show effective stats) ===\n'); result = await handleToolCall('get_character', { characterName: 'Exhausted Fighter' }); console.log(result.content[0].text); } test().catch(console.error);

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Mnehmos/ChatRPG'

If you have feedback or need assistance with the MCP directory API, please join our Discord server