Skip to main content
Glama
steveclarke

MCP Printer Server

by steveclarke

get_default_printer

Retrieve the name of the default printer configured in the system's CUPS printing system to enable document printing operations.

Instructions

Get the name of the default printer

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the 'get_default_printer' tool. It executes the 'lpstat -d' command using execCommand, parses the output to extract the default printer name, and returns a structured text response.
    async () => { const output = await execCommand("lpstat", ["-d"]) const defaultPrinter = output.split(": ")[1] || "No default printer set" return { content: [ { type: "text", text: `Default printer: ${defaultPrinter}`, }, ], } }
  • Registers the 'get_default_printer' tool with the MCP server, including a descriptive comment, metadata (title, description), empty input schema, and inline handler implementation.
    // get_default_printer - Get the default printer server.registerTool( "get_default_printer", { title: "Get Default Printer", description: "Get the name of the default printer", inputSchema: {}, }, async () => { const output = await execCommand("lpstat", ["-d"]) const defaultPrinter = output.split(": ")[1] || "No default printer set" return { content: [ { type: "text", text: `Default printer: ${defaultPrinter}`, }, ], } } )
  • The schema definition for the 'get_default_printer' tool, specifying title, description, and empty input schema (no parameters required).
    { title: "Get Default Printer", description: "Get the name of the default printer", inputSchema: {}, },

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