role_update
Modify permissions and settings for existing roles in Crafty Controller to adjust user access and capabilities.
Instructions
Update an existing role in Crafty Controller
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| role_id | Yes | Role ID to update | |
| updates | Yes | Role fields to update |
Implementation Reference
- src/tools/roles.ts:53-69 (handler)The handler logic for the role_update tool, which uses the CraftyClient to perform a PATCH request to update a role.
server.tool( "role_update", "Update an existing role in Crafty Controller", { role_id: z.string().describe("Role ID to update"), updates: z.record(z.string(), z.unknown()).describe("Role fields to update"), }, async ({ role_id, updates }) => { try { const data = await client.patch(`/roles/${role_id}`, updates); return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] }; } catch (error) { const msg = error instanceof Error ? error.message : String(error); return { content: [{ type: "text", text: `Error: ${msg}` }], isError: true }; } } );