Get Node Type Details
getNodeTypeDetailsGet schema, default template, and outcomes for node types to understand configuration requirements and outcomes before building journeys.
Instructions
Get complete details (schema, default template, and outcomes) for one or more node types. Use this before building journeys to understand what configuration each node type requires and what outcomes it produces.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| realm | Yes | The realm to query | |
| nodeTypes | Yes | Array of node type names to get details for (e.g., ["UsernameCollectorNode", "PasswordCollectorNode"]) |
Implementation Reference
- src/tools/am/getNodeTypeDetails.ts:27-47 (handler)The toolFunction handler for getNodeTypeDetails. It calls fetchNodeTypeDetails and returns the results.
async toolFunction({ realm, nodeTypes }: { realm: string; nodeTypes: string[] }) { try { const results = await fetchNodeTypeDetails(realm, nodeTypes, SCOPES); // Count successes and errors const resultValues = Object.values(results); const successCount = resultValues.filter((r) => r.error === null).length; const errorCount = resultValues.filter((r) => r.error !== null).length; const response = { realm, results, successCount, errorCount }; return createToolResponse(JSON.stringify(response, null, 2)); } catch (error: any) { return createToolResponse(`Failed to get node type details in realm "${realm}": ${error.message}`); } } - Input schema for getNodeTypeDetails: takes a realm (enum) and an array of node types (min 1).
inputSchema: { realm: z.enum(REALMS).describe('The realm to query'), nodeTypes: z .array(safePathSegmentSchema) .min(1) .describe( 'Array of node type names to get details for (e.g., ["UsernameCollectorNode", "PasswordCollectorNode"])' ) }, - src/index.ts:27-44 (registration)Generic tool registration loop: all tools (including getNodeTypeDetails) are registered via server.registerTool.
allTools.forEach((tool) => { const toolConfig: ToolConfig = { title: tool.title, description: tool.description }; // Only add inputSchema if it exists (some tools like getLogSources don't have one) if ('inputSchema' in tool && tool.inputSchema) { toolConfig.inputSchema = tool.inputSchema; } // Add annotations if present if ('annotations' in tool && tool.annotations) { toolConfig.annotations = tool.annotations; } server.registerTool(tool.name, toolConfig, tool.toolFunction as any); }); - src/tools/am/index.ts:6-6 (registration)Re-exports getNodeTypeDetailsTool from the AM tools index.
export { getNodeTypeDetailsTool } from './getNodeTypeDetails.js'; - src/utils/amHelpers.ts:364-415 (helper)The fetchNodeTypeDetails function: fetches schema, template, and outcomes for multiple node types in parallel from the AM API.
export async function fetchNodeTypeDetails( realm: string, nodeTypes: string[], scopes: string[] ): Promise<Record<string, NodeTypeDetailsResult>> { const results: Record<string, NodeTypeDetailsResult> = {}; await Promise.all( nodeTypes.map(async (nodeType) => { const baseUrl = buildAMJourneyNodesUrl(realm, nodeType); try { // Fetch all three endpoints in parallel for this node type const [schemaRes, templateRes, outcomesRes] = await Promise.all([ makeAuthenticatedRequest(`${baseUrl}?_action=schema`, scopes, { method: 'POST', headers: AM_API_HEADERS, body: JSON.stringify({}) }), makeAuthenticatedRequest(`${baseUrl}?_action=template`, scopes, { method: 'POST', headers: AM_API_HEADERS, body: JSON.stringify({}) }), makeAuthenticatedRequest(`${baseUrl}?_action=listOutcomes`, scopes, { method: 'POST', headers: AM_API_HEADERS, body: JSON.stringify({}) }) ]); results[nodeType] = { nodeType, schema: schemaRes.data, template: templateRes.data, outcomes: outcomesRes.data as Array<{ id: string; displayName: string }>, error: null }; } catch (error: any) { results[nodeType] = { nodeType, schema: null, template: null, outcomes: null, error: error.message }; } }) ); return results; }