Skip to main content
Glama

set-api-url

Configure the API base URL to establish connection with PI Dashboard resources for managing categories and charts through the MCP server.

Instructions

Set the API base URL for all requests

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesAPI base URL (e.g., http://localhost:8224/pi/api/v2)

Implementation Reference

  • build/index.js:312-345 (registration)
    Full registration of the 'set-api-url' tool, including input schema validation with Zod and the complete inline handler function that validates the URL, sets the global API_BASE_URL and flags, and returns success/error messages.
    server.tool("set-api-url", "Set the API base URL for all requests", { url: z.string().describe("API base URL (e.g., http://localhost:8224/pi/api/v2)") }, async ({ url }) => { try { // Validate URL format try { new URL(url); } catch (e) { return { isError: true, content: [{ type: "text", text: `Invalid URL format. Please provide a valid URL including protocol (http:// or https://).` }] }; } API_BASE_URL = url; apiUrlSet = true; connectionVerified = false; return { content: [{ type: "text", text: `API URL set to: ${url}\n\nNext step: Please authenticate to start using the API.` }] }; } catch (error) { return { isError: true, content: [{ type: "text", text: `Error setting API URL: ${getErrorMessage(error)}` }] }; } });

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/mingzilla/pi-api-mcp-server'

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