set-organization
Configure the organization ID to manage PI Dashboard resources for subsequent API requests.
Instructions
Set the organization ID for subsequent requests
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| orgId | Yes | Organization ID |
Implementation Reference
- build/index.js:576-592 (handler)Handler function that sets the global organization ID variable and returns a confirmation message or error response.}, 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)}` }] }; } });
- build/index.js:575-575 (schema)Zod input schema defining the required 'orgId' parameter as a number.orgId: z.number().describe("Organization ID")
- build/index.js:574-592 (registration)Tool registration call that defines the name, description, input schema, and inline handler function for 'set-organization'.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)}` }] }; } });