logging-list
Retrieve recent log entries from Simplifier with filtering by log level and time range. Access debug, info, warning, error, or critical logs using pagination and timestamp parameters.
Instructions
Get recent log entries from Simplifier
This tool provides access to the Simplifier logging system. You can filter logs by level and time range. If no filters are used, it returns the 50 most recent log entries. If you are expecting to find some logs but they are missing, ask the user to check whether logging for execution is set to the right level in the Simplifier server settings.
Log Levels:
0 = Debug
1 = Info
2 = Warning
3 = Error
4 = Critical
Parameters:
pageSize: number of log entries to return in one request, defaults to 50.
page: if more than "pageSize" entries are available, this can be used for accessing later pages. Starts at 0, defaults to 0.
logLevel: Filter by minimum log level (0-4)
since: ISO timestamp for entries since this time
from/until: ISO timestamps for a time range (must be used together)
Examples:
Default: Get 50 most recent entries
logLevel=3: Only errors and critical
since="2025-01-01T00:00:00Z": Entries since date
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pageSize | No | Number of log entries to return, defaults to 50 | |
| page | No | Page number for pagination, starts at 0 | |
| logLevel | No | Filter by minimum log level (0=Debug, 1=Info, 2=Warning, 3=Error, 4=Critical) | |
| since | No | ISO timestamp - get entries since this time | |
| from | No | ISO timestamp - start of time range (must be used with until) | |
| until | No | ISO timestamp - end of time range (must be used with from) |
Implementation Reference
- src/tools/logging-tools.ts:67-106 (handler)The handler function for the 'logging-list' tool. Processes pagination and filter parameters, fetches paginated log entries from SimplifierClient, maps them to resource objects using getLevelName helper, retrieves total pages, and returns a structured JSON response with logs list, pagination metadata, and applied filters.async ({ pageSize, page, logLevel, since, from, until }) => { return wrapToolResult('list log entries', async () => { const trackingKey = trackingToolPrefix + toolNameLoggingList const options: SimplifierLogListOptions = {}; if (logLevel !== undefined) options.logLevel = logLevel; if (since) options.since = since; if (from && until) { options.from = from; options.until = until; } const response = await simplifier.listLogEntriesPaginated(page, pageSize, trackingKey, options); const pageCount = await simplifier.getLogPages(pageSize, options); const logEntryResources = response.list.map((entry: SimplifierLogEntry) => ({ uri: `simplifier://logging/entry/${entry.id}`, id: entry.id, date: entry.entryDate, level: entry.level, levelName: getLevelName(entry.level), category: entry.category, messageKey: entry.messageKey, hasDetails: entry.hasDetails })); return { logs: logEntryResources, totalCount: response.list.length, page: page, pageSize: pageSize, totalPages: pageCount.pages, filters: { logLevel: options.logLevel, since: options.since, from: options.from, until: options.until } }; }); }
- src/tools/logging-tools.ts:46-59 (schema)Input schema for the 'logging-list' tool defined using Zod validators for parameters: pageSize (default 50), page (default 0), logLevel (0-4), since, from, until with appropriate descriptions.{ pageSize: z.number().optional().default(DEFAULT_PAGE_SIZE) .describe(`Number of log entries to return, defaults to ${DEFAULT_PAGE_SIZE}`), page: z.number().optional().default(0) .describe('Page number for pagination, starts at 0'), logLevel: z.number().min(0).max(4).optional() .describe('Filter by minimum log level (0=Debug, 1=Info, 2=Warning, 3=Error, 4=Critical)'), since: z.string().optional() .describe('ISO timestamp - get entries since this time'), from: z.string().optional() .describe('ISO timestamp - start of time range (must be used with until)'), until: z.string().optional() .describe('ISO timestamp - end of time range (must be used with from)') },
- src/tools/logging-tools.ts:13-108 (registration)The registerLoggingTools function that registers the 'logging-list' tool on the MCP server, providing tool name, detailed markdown description, input schema, metadata hints, and the handler implementation.export function registerLoggingTools(server: McpServer, simplifier: SimplifierClient): void { const DEFAULT_PAGE_SIZE = 50; /* Note: this could be turned into a resource, if https://github.com/modelcontextprotocol/typescript-sdk/issues/149 is fixed */ const toolNameLoggingList = "logging-list" server.tool(toolNameLoggingList, `# Get recent log entries from Simplifier This tool provides access to the Simplifier logging system. You can filter logs by level and time range. If no filters are used, it returns the ${DEFAULT_PAGE_SIZE} most recent log entries. If you are expecting to find some logs but they are missing, ask the user to check whether logging for execution is set to the right level in the Simplifier server settings. **Log Levels:** - 0 = Debug - 1 = Info - 2 = Warning - 3 = Error - 4 = Critical **Parameters:** - pageSize: number of log entries to return in one request, defaults to ${DEFAULT_PAGE_SIZE}. - page: if more than "pageSize" entries are available, this can be used for accessing later pages. Starts at 0, defaults to 0. - logLevel: Filter by minimum log level (0-4) - since: ISO timestamp for entries since this time - from/until: ISO timestamps for a time range (must be used together) **Examples:** - Default: Get 50 most recent entries - logLevel=3: Only errors and critical - since="2025-01-01T00:00:00Z": Entries since date `, { pageSize: z.number().optional().default(DEFAULT_PAGE_SIZE) .describe(`Number of log entries to return, defaults to ${DEFAULT_PAGE_SIZE}`), page: z.number().optional().default(0) .describe('Page number for pagination, starts at 0'), logLevel: z.number().min(0).max(4).optional() .describe('Filter by minimum log level (0=Debug, 1=Info, 2=Warning, 3=Error, 4=Critical)'), since: z.string().optional() .describe('ISO timestamp - get entries since this time'), from: z.string().optional() .describe('ISO timestamp - start of time range (must be used with until)'), until: z.string().optional() .describe('ISO timestamp - end of time range (must be used with from)') }, { title: "List Simplifier Log Entries", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false }, async ({ pageSize, page, logLevel, since, from, until }) => { return wrapToolResult('list log entries', async () => { const trackingKey = trackingToolPrefix + toolNameLoggingList const options: SimplifierLogListOptions = {}; if (logLevel !== undefined) options.logLevel = logLevel; if (since) options.since = since; if (from && until) { options.from = from; options.until = until; } const response = await simplifier.listLogEntriesPaginated(page, pageSize, trackingKey, options); const pageCount = await simplifier.getLogPages(pageSize, options); const logEntryResources = response.list.map((entry: SimplifierLogEntry) => ({ uri: `simplifier://logging/entry/${entry.id}`, id: entry.id, date: entry.entryDate, level: entry.level, levelName: getLevelName(entry.level), category: entry.category, messageKey: entry.messageKey, hasDetails: entry.hasDetails })); return { logs: logEntryResources, totalCount: response.list.length, page: page, pageSize: pageSize, totalPages: pageCount.pages, filters: { logLevel: options.logLevel, since: options.since, from: options.from, until: options.until } }; }); } ); }
- src/tools/index.ts:14-20 (registration)Top-level tool registration in registerTools function, including the call to registerLoggingTools(server, simplifier) which sets up the logging-list tool among others.registerServerBusinessObjectTools(server, simplifier) registerServerDatatypeTools(server, simplifier) registerConnectorTools(server, simplifier) registerLoginMethodTools(server, simplifier) registerLoggingTools(server, simplifier) registerSapSystemTools(server, simplifier) }
- src/tools/logging-tools.ts:8-11 (helper)Utility helper function getLevelName that maps numeric log levels (0-4) to string names used in both log entry resources and handler output.function getLevelName(level: number): string { const levels = ['Debug', 'Info', 'Warning', 'Error', 'Critical']; return levels[level] || 'Unknown'; }