GetNodeStructureLow
Fetch node structure for object tree navigation in ADT repository. Use parent type and name to discover structure, with optional node ID for child nodes.
Instructions
[low-level] Fetch node structure from ADT repository. Used for object tree navigation and structure discovery. Can use session_id and session_state from GetSession to maintain the same session.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| parent_type | Yes | Parent object type (e.g., "CLAS/OC", "PROG/P", "DEVC/K") | |
| parent_name | Yes | Parent object name | |
| node_id | No | Optional node ID (default: "0000" for root). Use to fetch child nodes. | 0000 |
| with_short_descriptions | No | Include short descriptions in response | |
| session_id | No | Session ID from GetSession. If not provided, a new session will be created. | |
| session_state | No | Session state from GetSession (cookies, csrf_token, cookie_store). Required if session_id is provided. |
Implementation Reference
- Main handler function for the GetNodeStructureLow tool. Validates args, optionally restores session state, creates ADT client, and calls fetchNodeStructure to retrieve node structure data from ADT repository.
export async function handleGetNodeStructure( context: HandlerContext, args: GetNodeStructureArgs, ) { const { connection, logger } = context; try { // Validate required parameters if (!args?.parent_type) { return return_error(new Error('parent_type is required')); } if (!args?.parent_name) { return return_error(new Error('parent_name is required')); } // Restore session state if provided if (args.session_id && args.session_state) { const { restoreSessionInConnection } = await import( '../../../lib/utils.js' ); await restoreSessionInConnection( connection, args.session_id, args.session_state, ); } // Create AdtClient and get utilities const client = createAdtClient(connection, logger); const utils = client.getUtils(); logger?.info( `Fetching node structure for ${args.parent_type}/${args.parent_name}`, ); const result = await utils.fetchNodeStructure( args.parent_type, args.parent_name, args.node_id || '0000', args.with_short_descriptions !== false, ); logger?.debug( `Node structure fetched successfully for ${args.parent_type}/${args.parent_name}`, ); return return_response(result); } catch (error: any) { logger?.error('Failed to fetch node structure', error); return return_error(error); } } - TOOL_DEFINITION including name 'GetNodeStructureLow', description, and inputSchema with properties: parent_type, parent_name, node_id, with_short_descriptions, session_id, session_state.
export const TOOL_DEFINITION = { name: 'GetNodeStructureLow', available_in: ['onprem', 'cloud'] as const, description: '[low-level] Fetch node structure from ADT repository. Used for object tree navigation and structure discovery. Can use session_id and session_state from GetSession to maintain the same session.', inputSchema: { type: 'object', properties: { parent_type: { type: 'string', description: 'Parent object type (e.g., "CLAS/OC", "PROG/P", "DEVC/K")', }, parent_name: { type: 'string', description: 'Parent object name', }, node_id: { type: 'string', description: 'Optional node ID (default: "0000" for root). Use to fetch child nodes.', default: '0000', }, with_short_descriptions: { type: 'boolean', description: 'Include short descriptions in response', default: true, }, session_id: { type: 'string', description: 'Session ID from GetSession. If not provided, a new session will be created.', }, session_state: { type: 'object', description: 'Session state from GetSession (cookies, csrf_token, cookie_store). Required if session_id is provided.', properties: { cookies: { type: 'string' }, csrf_token: { type: 'string' }, cookie_store: { type: 'object' }, }, }, }, required: ['parent_type', 'parent_name'], }, } as const; - src/lib/handlers/groups/SystemHandlersGroup.ts:273-278 (registration)Registration of GetNodeStructureLow tool in SystemHandlersGroup, linking TOOL_DEFINITION to handleGetNodeStructure handler.
{ toolDefinition: GetNodeStructureLow_Tool, handler: (args: any) => { return handleGetNodeStructure(this.context, args); }, }, - src/lib/handlers/groups/SystemHandlersGroup.ts:5-8 (registration)Import of TOOL_DEFINITION as GetNodeStructureLow_Tool and handleGetNodeStructure from the handler file.
import { TOOL_DEFINITION as GetNodeStructureLow_Tool, handleGetNodeStructure, } from '../../../handlers/system/low/handleGetNodeStructure';