update_identity_custom_field
Update an existing identity custom field. Modify its display name and unique code.
Instructions
Update an existing identity custom field configuration. Can modify field name and code.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| customFieldId | Yes | The ID of the custom field to update | |
| attributeName | No | Display label for the custom field | |
| attributeCode | No | Unique identifier for the custom field. Must contain only lowercase letters, numbers, and underscores. |
Implementation Reference
- The main handler function that executes the update_identity_custom_field tool logic. It builds a request body from optional params (attributeName, attributeCode) and makes a PATCH API call to /identity/fields/custom/{customFieldId}.
export async function updateIdentityCustomField(params: UpdateIdentityCustomFieldParams) { const client = getClient(); const body: Record<string, unknown> = {}; if (params.attributeName !== undefined) body.attributeName = params.attributeName; if (params.attributeCode !== undefined) body.attributeCode = params.attributeCode; return client.makePatchApiCall(`/identity/fields/custom/${params.customFieldId}`, body); } - Zod schema defining the input parameters: customFieldId (required number), attributeName (optional string), attributeCode (optional string matching lowercase letters, numbers, underscores).
export const UpdateIdentityCustomFieldSchema = z.object({ customFieldId: z.number().describe("The ID of the custom field to update"), attributeName: z.string().optional().describe("Display label for the custom field"), attributeCode: z .string() .optional() .describe("Unique identifier for the custom field. Must contain only lowercase letters, numbers, and underscores."), }); - src/index.ts:278-282 (registration)Registration of the tool with name 'update_identity_custom_field', description, and inputSchema in the ListToolsRequestSchema handler.
{ name: "update_identity_custom_field", description: "Update an existing identity custom field configuration. Can modify field name and code.", inputSchema: zodToJsonSchema(UpdateIdentityCustomFieldSchema), }, - src/index.ts:330-332 (registration)Tool handler registration in the toolHandlers map, which parses input via UpdateIdentityCustomFieldSchema and calls updateIdentityCustomField.
update_identity_custom_field: async (input) => updateIdentityCustomField(UpdateIdentityCustomFieldSchema.parse(input)), delete_identity_custom_field: async (input) => - src/admina-api.ts:89-113 (helper)The makePatchApiCall method on AdminaApiClient that performs the actual PATCH HTTP request, used by the handler to update the identity custom field.
public async makePatchApiCall<T>( endpoint: string, body: Record<string, unknown> = {}, config: AxiosRequestConfig = {}, ): Promise<T> { try { const url = `${this.ADMINA_API_BASE}/organizations/${this.organizationId}${endpoint}`; const response = await axios.patch(url, body, { headers: { Authorization: `Bearer ${this.apiKey}`, "Content-Type": "application/json", ...MCP_USAGE_TRACKING_HEADERS, }, ...config, }); return response.data as T; } catch (error: unknown) { if (error instanceof AxiosError) { throw createAdminaError(error.status ?? 500, error.response?.data); } throw createAdminaError(500, { errorId: "non_axios_error" }); } }