get-audit-logs
Retrieve audit events from Miro to monitor user activities, track changes, and ensure compliance within enterprise environments.
Instructions
Retrieves a page of audit events from the last 90 days (Enterprise only)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| createdAfter | Yes | Retrieve audit logs created after this date (ISO 8601 format) | |
| createdBefore | Yes | Retrieve audit logs created before this date (ISO 8601 format) | |
| cursor | No | Cursor for pagination | |
| limit | No | Maximum number of results to return (default: 100) | |
| sorting | No | Sort order for results (default: ASC) |
Implementation Reference
- src/tools/getAuditLogs.ts:16-34 (handler)The handler function that executes the tool's core logic: constructs a query from parameters and calls MiroClient.getApi().enterpriseGetAuditLogs to fetch audit logs.fn: async ({ createdAfter, createdBefore, cursor, limit, sorting }) => { try { const query: any = {}; if (cursor) query.cursor = cursor; if (limit) query.limit = limit; if (sorting) query.sorting = sorting; const response = await MiroClient.getApi().enterpriseGetAuditLogs( createdAfter, createdBefore, query ); return ServerResponse.text(JSON.stringify(response.body, null, 2)); } catch (error) { process.stderr.write(`Error retrieving audit logs: ${error}\n`); return ServerResponse.error(error); } }
- src/tools/getAuditLogs.ts:9-15 (schema)Zod schema defining the input parameters for the get-audit-logs tool, including descriptions.args: { createdAfter: z.string().describe("Retrieve audit logs created after this date (ISO 8601 format)"), createdBefore: z.string().describe("Retrieve audit logs created before this date (ISO 8601 format)"), cursor: z.string().optional().nullish().describe("Cursor for pagination"), limit: z.number().optional().nullish().describe("Maximum number of results to return (default: 100)"), sorting: z.enum(["ASC", "DESC"]).optional().nullish().describe("Sort order for results (default: ASC)") },
- src/index.ts:195-195 (registration)Registers the get-audit-logs tool (imported as getAuditLogsTool) with the ToolBootstrapper instance..register(getAuditLogsTool)