Skip to main content
Glama

set-organization

Define the organization ID for subsequent API requests to manage PI Dashboard resources efficiently. Ensure accurate access and control with the specified organization.

Instructions

Set the organization ID for subsequent requests

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
orgIdYesOrganization ID

Implementation Reference

  • build/index.js:574-592 (registration)
    Registration of the 'set-organization' tool, including inline schema validation using Zod (orgId: number) and handler function that sets a global orgId variable to the input value and returns a confirmation message. The handler also includes error handling using getErrorMessage.
    server.tool("set-organization", "Set the organization ID for subsequent requests", { orgId: z.number().describe("Organization ID") }, async ({ orgId: newOrgId }) => { try { orgId = newOrgId; return { content: [{ type: "text", text: `Organization ID set to ${newOrgId}` }] }; } catch (error) { return { isError: true, content: [{ type: "text", text: `Error setting organization ID: ${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