list_printers
Discover available printers and their current status to identify which devices are ready for printing tasks.
Instructions
List all available printers on the system with their status. Returns printer names, states, and whether they're accepting jobs.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/printer.ts:84-94 (handler)Handler function that runs the 'lpstat -p -d' command to list all available printers and their status, returning the output as text content.async () => { const output = await execCommand("lpstat", ["-p", "-d"]) return { content: [ { type: "text", text: output || "No printers found", }, ], } }
- src/tools/printer.ts:78-83 (schema)Input schema for the list_printers tool (empty, no input parameters required), including title and description.{ title: "List Printers", description: "List all available printers on the system with their status. Returns printer names, states, and whether they're accepting jobs.", inputSchema: {}, },
- src/tools/printer.ts:76-95 (registration)Direct registration of the list_printers tool with the MCP server, specifying schema and inline handler.server.registerTool( "list_printers", { title: "List Printers", description: "List all available printers on the system with their status. Returns printer names, states, and whether they're accepting jobs.", inputSchema: {}, }, async () => { const output = await execCommand("lpstat", ["-p", "-d"]) return { content: [ { type: "text", text: output || "No printers found", }, ], } } )
- src/tools/index.ts:22-22 (registration)Top-level registration call to registerPrinterTools within registerAllTools, which includes the list_printers tool.registerPrinterTools(server)