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)}` }]
            };
        }
    });
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden but only states what the tool does, not how it behaves. It doesn't disclose whether this is a persistent configuration, if it affects all subsequent requests, what validation occurs, or potential side effects. For a configuration tool with zero annotation coverage, this is inadequate.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the essential information with zero wasted words. Every word earns its place in communicating the core functionality.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a configuration tool with no annotations and no output schema, the description is insufficient. It doesn't explain what happens after setting the URL, whether the change is persistent, how to verify it worked, or what errors might occur. Given the tool's potential impact on all subsequent operations, more context is needed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema fully documents the single 'url' parameter with an example. The description adds no additional parameter semantics beyond what's in the schema, meeting the baseline for high coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Set') and the target ('API base URL for all requests'), making the purpose immediately understandable. It doesn't distinguish from siblings like 'set-organization' or 'check-connection', but the verb+resource combination is specific enough for basic understanding.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives or prerequisites. The description implies it configures API endpoints globally, but doesn't specify if it should be called before other operations, if it persists across sessions, or how it relates to tools like 'check-connection' or 'authenticate'.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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