Skip to main content
Glama
steveclarke

MCP Printer Server

by steveclarke

set_default_printer

Set a specific printer as the default printing device for your macOS or Linux system using the CUPS printing system.

Instructions

Set a printer as the default printer

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
printerYesPrinter name to set as default

Implementation Reference

  • Handler function that sets the default printer using the `lpoptions -d` command and returns a confirmation message.
    async ({ printer }) => { await execa("lpoptions", ["-d", printer]) return { content: [ { type: "text", text: `✓ Set default printer to: ${printer}`, }, ], } }
  • Input schema defining the required 'printer' parameter as a string.
    inputSchema: { printer: z.string().describe("Printer name to set as default"), },
  • Conditional registration of the 'set_default_printer' tool with the MCP server, including title, description, input schema, and handler. Only registered if management operations are enabled in config.
    if (config.enableManagement) { server.registerTool( "set_default_printer", { title: "Set Default Printer", description: "Set a printer as the default printer", inputSchema: { printer: z.string().describe("Printer name to set as default"), }, }, async ({ printer }) => { await execa("lpoptions", ["-d", printer]) return { content: [ { type: "text", text: `✓ Set default printer to: ${printer}`, }, ], } } ) }
  • High-level registration call to registerPrinterTools, which includes the set_default_printer tool.
    registerPrinterTools(server)

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/steveclarke/mcp-printer'

If you have feedback or need assistance with the MCP directory API, please join our Discord server