get_package
Retrieve a package by its unique ID to access its details and current status.
Instructions
Get package by id
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| packageId | Yes | Id of the package to retrieve |
Implementation Reference
- src/index.ts:86-101 (registration)Registration of the 'get_package' tool on the MCP server. Maps the tool name to the handler function 'getPackage' and schema 'GetPackageSchema'.
server.registerTool( "get_package", { description: "Get package by id", inputSchema: GetPackageSchema.shape, }, async (args) => { try { const data = await getPackage(args); return mcpOk(data); } catch (error) { return mcpError(error); } }, ); - src/api/packages.ts:86-88 (schema)Zod schema for the 'get_package' tool input validation. Defines a required 'packageId' string parameter describing the ID of the package to retrieve.
const GetPackageSchema = z.object({ packageId: z.string().describe("Id of the package to retrieve"), }); - src/api/packages.ts:92-106 (handler)Handler function for 'get_package'. Makes a GET request to MASV API v1.1 teams/{teamId}/packages/{packageId} and returns the package data.
async function getPackage({ packageId }: GetPackageParams) { const url = new URL( `${MASV_BASE_URL}/v1.1/teams/${MASV_TEAM_ID}/packages/${packageId}`, ); const headers = { "content-type": "application/json", "x-api-key": MASV_API_KEY, }; const r = await fetch(url.toString(), { headers }); const data = await r.json(); return data; } - src/api/packages.ts:344-360 (helper)Exports including GetPackageSchema and getPackage function used by the tool registration and handler.
export { GetPackagesSchema, getPackages, GetPackageSchema, getPackage, GetPortalPackagesSchema, getPortalPackages, GetPackageFilesSchema, getPackageFiles, GetPackageTransfersSchema, getPackageTransfers, UpdatePackageExpiryDateSchema, updatePackageExpiry, DeletePackageSchema, deletePackage, getPackageToken, };