runway_getOrg
Retrieve organization details including credit balance and usage information to monitor account resources and track API consumption.
Instructions
Returns details like credit balance, usage details, and organization information.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:214-217 (handler)Inline handler function for the 'runway_getOrg' tool. Fetches organization details from Runway API using callRunway helper and returns the JSON stringified response.async () => { const org = await callRunway("/organization"); return { content: [{ type: "text", text: JSON.stringify(org) }] }; }
- src/index.ts:210-218 (registration)Registration of the 'runway_getOrg' tool using server.tool, including name, description, empty input schema, and inline handler.server.tool( "runway_getOrg", "Returns details like credit balance, usage details, and organization information.", {}, async () => { const org = await callRunway("/organization"); return { content: [{ type: "text", text: JSON.stringify(org) }] }; } );
- src/index.ts:213-213 (schema)Empty input schema (zod validation) for the 'runway_getOrg' tool, indicating no parameters required.{},
- src/index.ts:27-42 (helper)Helper function used by the tool handler to make authenticated API requests to the RunwayML backend.async function callRunway( path: string, opts: Partial<RequestInit> = {} ): Promise<unknown> { const res = await fetch(`${API_BASE}${path}`, { ...opts, headers: { Authorization: `Bearer ${SECRET}`, "X-Runway-Version": RUNWAY_VERSION, "Content-Type": "application/json", ...(opts.headers || {}), }, } as RequestInit); if (!res.ok) throw new Error(`Runway ${res.status}: ${await res.text()}`); return res.json(); }