get_portal
Retrieve a specific portal by ID to access its configuration, recipients, connected integrations, and settings.
Instructions
Get a specific portal by ID. Returns detailed information about the portal including its configuration, recipients, connected integrations, and settings.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| portalId | Yes | Id of the portal to retrieve |
Implementation Reference
- src/index.ts:334-350 (registration)MCP tool registration for 'get_portal' - registers the tool with description, input schema, and a handler that calls getPortal()
server.registerTool( "get_portal", { description: "Get a specific portal by ID. Returns detailed information about the portal including its configuration, recipients, connected integrations, and settings.", inputSchema: GetPortalSchema.shape, }, async (args) => { try { const data = await getPortal(args); return mcpOk(data); } catch (error) { return mcpError(error); } }, ); - src/api/portals.ts:74-86 (handler)Handler function that executes the tool logic - fetches portal details from the MASV API using the portalId
async function getPortal({ portalId }: GetPortalParams) { const url = new URL(`${MASV_BASE_URL}/v1.1/portals/${portalId}`); 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/portals.ts:68-70 (schema)Zod schema defining the input for get_portal - requires a portalId string parameter
const GetPortalSchema = z.object({ portalId: z.string().describe("Id of the portal to retrieve"), }); - src/api/env.ts:11-14 (helper)Environment variables used by getPortal - MASV_BASE_URL for the API endpoint, MASV_API_KEY for authentication
export const MASV_BASE_URL = process.env.MASV_BASE_URL || "https://api.massive.app"; export const MASV_TEAM_ID = process.env.MASV_TEAM_ID; export const MASV_API_KEY = process.env.MASV_API_KEY; export const MASV_ALLOW_DELETE = process.env.MASV_ALLOW_DELETE === "true"; - src/mcp-responses.ts:1-19 (helper)Helper functions used by get_portal handler - mcpOk formats successful responses, mcpError formats error responses
export function mcpOk(data: object | string) { return { content: [ { type: "text" as const, text: typeof data === "string" ? data : JSON.stringify(data, null, 2), }, ], }; } export function mcpError(data: unknown) { const message = data instanceof Error ? data.message : String(data); return { isError: true, content: [{ type: "text" as const, text: message }], }; }