Skip to main content
Glama

update_character

Modify existing D&D 5e character attributes including stats, level, equipment, spells, and abilities to reflect gameplay changes and progression.

Instructions

Update an existing D&D 5e character with new stats, HP, level, equipment, etc.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
characterIdNo
characterNameNo
nameNo
raceNo
classNo
levelNo
backgroundNo
characterTypeNo
statsNo
hpNo
healingNo
maxHpNo
acNo
speedNo
resistancesNo
immunitiesNo
vulnerabilitiesNo
conditionImmunitiesNo
spellcastingAbilityNo
knownSpellsNo
preparedSpellsNo
cantripsNo
skillProficienciesNo
saveProficienciesNo
equipmentNo
customClassNo
customRaceNo
resourceNo
batchNo

Implementation Reference

  • Registration of the 'update_character' tool, specifying name, description, input schema (referencing updateCharacterSchema), and inline handler function that validates arguments and delegates to updateCharacter function.
    update_character: { name: 'update_character', description: 'Update an existing D&D 5e character with new stats, HP, level, equipment, etc.', inputSchema: toJsonSchema(updateCharacterSchema), handler: async (args) => { try { const validated = updateCharacterSchema.parse(args); const result = updateCharacter(validated); if (!result.success) { return error(result.error || 'Failed to update character'); } return success(result.markdown); } catch (err) { if (err instanceof z.ZodError) { const messages = err.errors.map(e => `${e.path.join('.')}: ${e.message}`).join(', '); return error(`Validation failed: ${messages}`); } const message = err instanceof Error ? err.message : String(err); return error(message); } }, },
  • The tool handler implementation: parses input using updateCharacterSchema, calls the core updateCharacter function with validated args, handles success/error responses with markdown formatting using success/error helpers.
    handler: async (args) => { try { const validated = updateCharacterSchema.parse(args); const result = updateCharacter(validated); if (!result.success) { return error(result.error || 'Failed to update character'); } return success(result.markdown); } catch (err) { if (err instanceof z.ZodError) { const messages = err.errors.map(e => `${e.path.join('.')}: ${e.message}`).join(', '); return error(`Validation failed: ${messages}`); } const message = err instanceof Error ? err.message : String(err); return error(message); }

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