list_printers
Discover available printers on your system and check their current status, including whether they're ready to accept print jobs.
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)The handler function for the list_printers tool. It runs the `lpstat -p -d` command to list all available printers on the system with their status and returns the output as markdown text content.async () => { const output = await execCommand("lpstat", ["-p", "-d"]) return { content: [ { type: "text", text: output || "No printers found", }, ], } }
- src/tools/printer.ts:76-95 (registration)Registers the list_printers tool with the MCP server, providing title, description, empty input schema (no parameters required), and the inline handler function.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", }, ], } } )