get_portal_packages
Get packages uploaded to MASV Portals with filters for status, name, sender, portal, tags, dates, teamspaces, expiry, and extra storage. Use this tool to retrieve portal-specific packages not including team packages.
Instructions
Get portal packages. These are packages uploaded by anyone to MASV Portals. Only packages that were uploaded to Portals returned by this tool. To get full list of packages you need to get both team packages and portal packages.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page | No | Page number of paginated response. First page is 1 | |
| limit | No | Number of records returned per page | |
| sort | No | Sort results ascending (fieldname) or descending (-fieldname) | |
| status | No | Select packages with status. New - package is currently uploading and not ready for view/download yet, finalized - package was uploaded and is ready for download, view, or transfer to another storage destination, expired and archived means that package was deleted and files are not available anymore | |
| name | No | Filter packages by name | |
| sender | No | Filter packages by sender email | |
| portal | No | Retrieve records that belongs to the specified portal name | |
| tags | No | Filter packages by tag id. If any of provided tag ids match package will be returned | |
| created_at_start | No | Retrieve records that were created after (YYYY-MM-DDTHH:mm:SS) | |
| created_at_end | No | Retrieve records that were created before (YYYY-MM-DDTHH:mm:SS) | |
| teamspaces | No | Retrieve records where teamspace id is equal to one of these values | |
| expiry_start | No | Retrieve records that expire after (YYYY-MM-DDTHH:mm:SS) | |
| expiry_end | No | Retrieve records that expire before (YYYY-MM-DDTHH:mm:SS) | |
| extra_storage | No | If true, will only include packages which will or have already incurred extended storage costs |
Implementation Reference
- src/index.ts:103-119 (registration)Registration of the 'get_portal_packages' tool with server.registerTool, including description and schema binding to GetPortalPackagesSchema.shape
server.registerTool( "get_portal_packages", { description: "Get portal packages. These are packages uploaded by anyone to MASV Portals. Only packages that were uploaded to Portals returned by this tool. To get full list of packages you need to get both team packages and portal packages.", inputSchema: GetPortalPackagesSchema.shape, }, async (args) => { try { const data = await getPortalPackages(args); return mcpOk(data); } catch (error) { return mcpError(error); } }, ); - src/api/packages.ts:108-170 (schema)Zod schema definition for GetPortalPackagesSchema - input validation for page, limit, sort, status, name, sender, portal, tags, created_at_start, created_at_end, teamspaces, expiry_start, expiry_end, extra_storage
const GetPortalPackagesSchema = z.object({ page: z .number() .min(1) .describe("Page number of paginated response. First page is 1") .optional(), limit: z .number() .min(1) .max(100) .describe("Number of records returned per page") .optional(), sort: z .string() .describe("Sort results ascending (fieldname) or descending (-fieldname)") .optional(), status: z .array(z.enum(["new", "finalized", "expired", "archived"])) .describe( "Select packages with status. New - package is currently uploading and not ready for view/download yet, finalized - package was uploaded and is ready for download, view, or transfer to another storage destination, expired and archived means that package was deleted and files are not available anymore", ) .optional(), name: z.string().describe("Filter packages by name").optional(), sender: z.string().describe("Filter packages by sender email").optional(), portal: z .string() .describe("Retrieve records that belongs to the specified portal name") .optional(), tags: z .array(z.string()) .describe( "Filter packages by tag id. If any of provided tag ids match package will be returned", ) .optional(), created_at_start: z .string() .describe("Retrieve records that were created after (YYYY-MM-DDTHH:mm:SS)") .optional(), created_at_end: z .string() .describe("Retrieve records that were created before (YYYY-MM-DDTHH:mm:SS)") .optional(), teamspaces: z .array(z.string()) .describe( "Retrieve records where teamspace id is equal to one of these values", ) .optional(), expiry_start: z .string() .describe("Retrieve records that expire after (YYYY-MM-DDTHH:mm:SS)") .optional(), expiry_end: z .string() .describe("Retrieve records that expire before (YYYY-MM-DDTHH:mm:SS)") .optional(), extra_storage: z .boolean() .describe( "If true, will only include packages which will or have already incurred extended storage costs", ) .optional(), }); - src/api/packages.ts:174-192 (handler)Core handler function getPortalPackages - fetches portal packages from MASV API at /v1.1/teams/{teamId}/inbox with query parameters and x-api-key auth header
async function getPortalPackages({ page, ...params }: GetPortalPackagesParams) { const url = new URL(`${MASV_BASE_URL}/v1.1/teams/${MASV_TEAM_ID}/inbox`); Object.entries(params).forEach(([key, value]) => { if (value !== undefined) { url.searchParams.append(key, String(value)); } }); 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:172-172 (helper)Type inference for GetPortalPackagesParams from the Zod schema
type GetPortalPackagesParams = z.infer<typeof GetPortalPackagesSchema>; - src/api/packages.ts:349-350 (helper)Exports of GetPortalPackagesSchema and getPortalPackages from the packages module
GetPortalPackagesSchema, getPortalPackages,