get_print_queue
Check pending and active print jobs for a specific printer or all printers to monitor print queue status.
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-126 (handler)The async handler function that implements the core logic of the get_print_queue tool. It constructs arguments for the 'lpq' command based on the optional printer input and executes it to retrieve the print queue status.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:104-109 (schema)The Zod input schema definition for the get_print_queue tool, specifying an optional 'printer' parameter.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)The complete registration of the get_print_queue tool with the MCP server using server.registerTool, including name, metadata (title, description), input schema, and 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", }, ], } } )