logs
View system logs filtered by context, tail to n lines, or keep the log stream open.
Instructions
Show system logs for a space with filtering and follow options.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tail | No | Chop log to n lines | |
| follow | No | Keep log stream open | |
| context | No | Filter log on: jobhooks, queuehooks, routehooks, datahooks, auth |
Implementation Reference
- src/index.ts:169-173 (schema)Zod schema definition for the 'logs' tool. Defines input validation with optional fields: tail (number, default 100), follow (boolean), and context (string for filtering on jobhooks, queuehooks, routehooks, datahooks, auth).
const logSchema = z.object({ tail: z.number().optional().default(100).describe("Chop log to n lines"), follow: z.boolean().optional().describe("Keep log stream open"), context: z.string().optional().describe("Filter log on: jobhooks, queuehooks, routehooks, datahooks, auth"), }); - src/index.ts:476-488 (registration)Tool registration entry for 'logs' in the tools array. Declares the tool name, description ('Show system logs for a space with filtering and follow options'), and inputSchema mapping to the logSchema fields.
{ name: "logs", description: "Show system logs for a space with filtering and follow options.", schema: logSchema, inputSchema: { type: "object", properties: { tail: { type: "number", description: "Chop log to n lines", default: 100 }, follow: { type: "boolean", description: "Keep log stream open" }, context: { type: "string", description: "Filter log on: jobhooks, queuehooks, routehooks, datahooks, auth" } } } }, - src/index.ts:1283-1305 (handler)Handler implementation for the 'logs' tool. Builds CLI arguments for the 'coho log' command with --project, --space, --tail, --follow, and --context flags, then executes via executeCohoCommand and returns the result as text.
case "logs": { const { tail = 100, follow, context } = args as LogArgs; const logArgs = [ 'log', '--project', config.projectId, '--space', config.space, '--tail', tail.toString() ]; if (follow) logArgs.push('--follow'); if (context) logArgs.push('--context', context); const result = await executeCohoCommand(logArgs); return { content: [ { type: "text", text: result } ], isError: false }; }