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
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"role_id": "<role_id>",
"updates": "<updates>"
},
"name": "role_update"
}
}Input 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 }; } } );