get-audit-logs
Retrieve audit logs from the Miro MCP server within a specified date range, with pagination and sorting options. Ideal for monitoring enterprise activity over the last 90 days.
Instructions
Retrieves a page of audit events from the last 90 days (Enterprise only)
Input 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) |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"createdAfter": {
"description": "Retrieve audit logs created after this date (ISO 8601 format)",
"type": "string"
},
"createdBefore": {
"description": "Retrieve audit logs created before this date (ISO 8601 format)",
"type": "string"
},
"cursor": {
"description": "Cursor for pagination",
"type": "string"
},
"limit": {
"description": "Maximum number of results to return (default: 100)",
"type": "number"
},
"sorting": {
"description": "Sort order for results (default: ASC)",
"enum": [
"ASC",
"DESC"
],
"type": "string"
}
},
"required": [
"createdAfter",
"createdBefore"
],
"type": "object"
}
Implementation Reference
- src/tools/getAuditLogs.ts:16-35 (handler)The core handler function implementing the logic for the 'get-audit-logs' tool. It builds a query from parameters and fetches audit logs via MiroClient API, handling errors appropriately.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)Input schema using Zod for validating parameters of the 'get-audit-logs' tool, including dates, pagination cursor, limit, and sorting.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)Registration of the get-audit-logs tool via ToolBootstrapper.register, which internally calls server.tool with the tool's schema..register(getAuditLogsTool)
- src/index.ts:94-94 (registration)Import of the getAuditLogsTool module for registration.import getAuditLogsTool from './tools/getAuditLogs.js';