affine_update_settings
Modify user preferences and settings within AFFiNE workspaces via a structured settings object to customize the user experience.
Instructions
Update user settings and preferences.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| settings | Yes | Settings object with key-value pairs |
Implementation Reference
- src/tools/userCRUD.ts:57-75 (handler)The async handler function that executes the tool logic: updates user settings by sending a GraphQL mutation to updateSettings with the provided settings object.const updateSettingsHandler = async ({ settings }: { settings: Record<string, any> }) => { try { const mutation = ` mutation UpdateSettings($input: UpdateUserSettingsInput!) { updateSettings(input: $input) { success } } `; const data = await gql.request<{ updateSettings: any }>(mutation, { input: settings }); return text(data.updateSettings); } catch (error: any) { return text({ error: error.message }); } };
- src/tools/userCRUD.ts:76-96 (registration)The server.registerTool call that registers the 'affine_update_settings' tool, including its title, description, inputSchema (using Zod), and references the handler.server.registerTool( "affine_update_settings", { title: "Update Settings", description: "Update user settings and preferences.", inputSchema: { settings: z.record(z.any()).describe("Settings object with key-value pairs") } }, updateSettingsHandler as any ); server.registerTool( "update_settings", { title: "Update Settings", description: "Update user settings and preferences.", inputSchema: { settings: z.record(z.any()).describe("Settings object with key-value pairs") } }, updateSettingsHandler as any
- src/tools/userCRUD.ts:81-83 (schema)The input schema definition using Zod for the tool's 'settings' parameter, defined inline in the registration.inputSchema: { settings: z.record(z.any()).describe("Settings object with key-value pairs") }