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
| Name | Required | Description | Default |
|---|---|---|---|
| orgId | Yes | Organization 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)}` }] }; } });