get_identity_history
Retrieve the change history of an identity, including field-level changes, action types, sources, and actors. Paginated results for easy browsing.
Instructions
Get the change history of a specific identity. Returns a paginated list of history records showing field-level changes, action types, sources, and actors.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| identityId | Yes | The ID of the identity to retrieve history for | |
| limit | No | Maximum number of history items to return per page. Defaults to 10. | |
| cursor | No | Base64-encoded cursor for pagination |
Implementation Reference
- src/tools/getIdentityHistory.ts:18-23 (handler)Main handler function that calls the Admina API at `/identity/{identityId}/history` with optional query params for pagination (limit, cursor).
export async function getIdentityHistory(params: GetIdentityHistoryParams) { const client = getClient(); const { identityId, ...rest } = params; const queryParams = filtersToParams(rest); return client.makeApiCall(`/identity/${identityId}/history`, queryParams); } - src/tools/getIdentityHistory.ts:5-14 (schema)Zod schema defining input parameters: identityId (required string), limit (optional positive integer, default 10), cursor (optional base64 string for pagination).
export const GetIdentityHistorySchema = z.object({ identityId: z.string().describe("The ID of the identity to retrieve history for"), limit: z .number() .int() .positive() .optional() .describe("Maximum number of history items to return per page. Defaults to 10."), cursor: z.string().optional().describe("Base64-encoded cursor for pagination"), }); - src/index.ts:255-258 (registration)Tool registration in the list of available tools with name 'get_identity_history', description, and JSON schema.
name: "get_identity_history", description: "Get the change history of a specific identity. Returns a paginated list of history records showing field-level changes, action types, sources, and actors.", inputSchema: zodToJsonSchema(GetIdentityHistorySchema), - src/index.ts:325-325 (registration)Tool handler registration mapping 'get_identity_history' to the getIdentityHistory function with schema parsing.
get_identity_history: async (input) => getIdentityHistory(GetIdentityHistorySchema.parse(input)), - src/common/helper.ts:1-19 (helper)Utility function filtersToParams used to convert the optional params (limit, cursor) into URL query parameters.
export function filtersToParams(filters: Record<string, any>): URLSearchParams { const queryParams = new URLSearchParams(); Object.entries(filters).forEach(([key, value]) => { if (value !== undefined && value !== null && !(Array.isArray(value) && value.length === 0)) { if (Array.isArray(value) && value.length > 0) { // Append each array value separately to generate format: key=value1&key=value2 value.forEach((item) => { queryParams.append(key, String(item)); }); } else if (typeof value === "boolean") { queryParams.append(key, value.toString()); } else { queryParams.append(key, String(value)); } } }); return queryParams; }