get_print_queue
Check print queue status to view pending and active print jobs for specific printers or all printers, helping monitor printing progress and identify queued documents.
Instructions
Check the print queue for a specific printer or all printers. Shows pending and active print jobs.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| printer | No | Printer name to check queue for (optional, checks all if not specified) |
Implementation Reference
- src/tools/printer.ts:111-127 (handler)Handler function for the 'get_print_queue' tool. Runs the 'lpq' command (optionally specifying a printer) to fetch the current print queue status and returns it as text content.async ({ printer }) => { const lpqArgs: string[] = [] if (printer) { lpqArgs.push("-P", printer) } const output = await execCommand("lpq", lpqArgs) return { content: [ { type: "text", text: output || "No print jobs in queue", }, ], } } )
- src/tools/printer.ts:100-110 (schema)Input schema and metadata (title, description) for the 'get_print_queue' tool, defining an optional 'printer' string parameter using Zod.{ title: "Get Print Queue", description: "Check the print queue for a specific printer or all printers. Shows pending and active print jobs.", inputSchema: { printer: z .string() .optional() .describe("Printer name to check queue for (optional, checks all if not specified)"), }, },
- src/tools/printer.ts:98-127 (registration)Registration of the 'get_print_queue' tool on the MCP server, including schema, metadata, and inline handler function.server.registerTool( "get_print_queue", { title: "Get Print Queue", description: "Check the print queue for a specific printer or all printers. Shows pending and active print jobs.", inputSchema: { printer: z .string() .optional() .describe("Printer name to check queue for (optional, checks all if not specified)"), }, }, async ({ printer }) => { const lpqArgs: string[] = [] if (printer) { lpqArgs.push("-P", printer) } const output = await execCommand("lpq", lpqArgs) return { content: [ { type: "text", text: output || "No print jobs in queue", }, ], } } )