get_package_transfers
Retrieve all transfers of a package to storage, including deliveries to cloud or on-premise destinations via MASV.
Instructions
Get all transfers of a package to storage. Transfer is a package delivery via MASV to cloud or on-premise (via MASV Storage Gateway) destination
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| packageId | Yes | Id of the package to retrieve transfers for. Transfer is a package delivery via MASV to cloud or on-premise (via MASV Storage Gateway) destination |
Implementation Reference
- src/api/packages.ts:231-245 (handler)Handler function that fetches all transfers for a given package by calling MASV API endpoint /v1/packages/{packageId}/transfer
async function getPackageTransfers({ packageId }: GetPackageTransfersParams) { const packageToken = await getPackageToken(packageId); const url = new URL(`${MASV_BASE_URL}/v1/packages/${packageId}/transfer`); const headers = { "content-type": "application/json", "x-package-token": packageToken, }; const r = await fetch(url.toString(), { headers }); const data = await r.json(); return data; } - src/api/packages.ts:221-227 (schema)Zod schema defining the input for getPackageTransfers (requires packageId string)
const GetPackageTransfersSchema = z.object({ packageId: z .string() .describe( "Id of the package to retrieve transfers for. Transfer is a package delivery via MASV to cloud or on-premise (via MASV Storage Gateway) destination", ), }); - src/index.ts:138-154 (registration)MCP server registration of the 'get_package_transfers' tool with description and input schema
server.registerTool( "get_package_transfers", { description: "Get all transfers of a package to storage. Transfer is a package delivery via MASV to cloud or on-premise (via MASV Storage Gateway) destination", inputSchema: GetPackageTransfersSchema.shape, }, async (args) => { try { const data = await getPackageTransfers(args); return mcpOk(data); } catch (error) { return mcpError(error); } }, ); - src/api/packages.ts:194-197 (helper)Helper function that retrieves an access token for a package, used by getPackageTransfers to authenticate the API call
async function getPackageToken(packageId: string) { const data = await getPackage({ packageId }); return data.access_token; }