Skip to main content
Glama

GetObjectNodeFromCache

Retrieve a cached node for an ABAP object by type, name, and technical name, expanding URI if present.

Instructions

[read-only] Returns a node from the in-memory objects list cache by OBJECT_TYPE, OBJECT_NAME, TECH_NAME, and expands OBJECT_URI if present.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
object_typeYes[read-only] Object type
object_nameYes[read-only] Object name
tech_nameYes[read-only] Technical name

Implementation Reference

  • The main handler function that looks up a cached node by object_type, object_name, tech_name, and optionally expands OBJECT_URI via an ADT request.
    export async function handleGetObjectNodeFromCache(
      context: HandlerContext,
      args: any,
    ) {
      const { connection, logger } = context;
      const { object_type, object_name, tech_name } = args;
      if (!object_type || !object_name || !tech_name) {
        return {
          isError: true,
          content: [
            { type: 'text', text: 'object_type, object_name, tech_name required' },
          ],
        };
      }
      const cache = objectsListCache.getCache();
      let node: any = null;
      if (cache && Array.isArray(cache.objects)) {
        node =
          (cache.objects as any[]).find(
            (obj: any) =>
              obj.OBJECT_TYPE === object_type &&
              obj.OBJECT_NAME === object_name &&
              obj.TECH_NAME === tech_name,
          ) || null;
      }
      if (!node) {
        logger?.debug(
          `Node ${object_type}/${object_name}/${tech_name} not found in cache`,
        );
        return {
          isError: true,
          content: [{ type: 'text', text: 'Node not found in cache' }],
        };
      }
      if (node.OBJECT_URI && !node.object_uri_response) {
        const buildEndpoint = (uri: string) => {
          if (uri.startsWith('http')) {
            try {
              const parsed = new URL(uri);
              return `${parsed.pathname}${parsed.search}`;
            } catch {
              // fall back to original if parsing fails
              return uri;
            }
          }
          return uri;
        };
        try {
          const endpoint = buildEndpoint(node.OBJECT_URI);
          const resp = await makeAdtRequest(connection, endpoint, 'GET', 15000);
          node.object_uri_response =
            typeof resp.data === 'string' ? resp.data : JSON.stringify(resp.data);
    
          // Persist the fetched OBJECT_URI payload back into the cache entry
          const idx = cache.objects.findIndex(
            (obj: any) =>
              obj.OBJECT_TYPE === object_type &&
              obj.OBJECT_NAME === object_name &&
              obj.TECH_NAME === tech_name,
          );
          if (idx >= 0) {
            cache.objects[idx] = {
              ...cache.objects[idx],
              object_uri_response: node.object_uri_response,
            };
            objectsListCache.setCache(cache);
          }
        } catch (e) {
          logger?.error('Failed to expand OBJECT_URI from cache', e as any);
          node.object_uri_response = `ERROR: ${e instanceof Error ? e.message : String(e)}`;
        }
      }
      logger?.info(
        `Returning cached node for ${object_type}/${object_name}/${tech_name}`,
      );
      return {
        content: [{ type: 'json', json: node }],
      };
    }
  • Tool definition including name 'GetObjectNodeFromCache', description, availability, and input schema (object_type, object_name, tech_name).
    export const TOOL_DEFINITION = {
      name: 'GetObjectNodeFromCache',
      available_in: ['onprem', 'cloud'] as const,
      description:
        '[read-only] Returns a node from the in-memory objects list cache by OBJECT_TYPE, OBJECT_NAME, TECH_NAME, and expands OBJECT_URI if present.',
      inputSchema: {
        type: 'object',
        properties: {
          object_type: { type: 'string', description: '[read-only] Object type' },
          object_name: { type: 'string', description: '[read-only] Object name' },
          tech_name: { type: 'string', description: '[read-only] Technical name' },
        },
        required: ['object_type', 'object_name', 'tech_name'],
      },
    } as const;
  • Registration of the tool in SystemHandlersGroup, mapping toolDefinition and handler to handleGetObjectNodeFromCache.
    {
      toolDefinition: GetObjectNodeFromCache_Tool,
      handler: (args: any) => {
        return handleGetObjectNodeFromCache(
          this.context,
          args as
            | { object_type: string; object_name: string }
            | {
                object_type: string;
                object_name: string;
                cache_type: string;
              },
        );
      },
    },
  • In-memory cache singleton used by the handler to store and retrieve the objects list.
    class ObjectsListCache {
      private cache: ObjectsListCacheType = null;
    
      setCache(data: any) {
        this.cache = data;
      }
    
      getCache(): ObjectsListCacheType {
        return this.cache;
      }
    
      clearCache() {
        this.cache = null;
      }
    }
    
    export const objectsListCache = new ObjectsListCache();
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description includes '[read-only]' and notes the expansion of OBJECT_URI, which are helpful. However, it lacks details on cache behavior, error handling, or what constitutes a 'node', leaving some ambiguity.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, well-structured sentence with no redundancy. It starts with the key attribute '[read-only]' and efficiently conveys the tool's purpose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

No output schema exists, yet the description does not explain the structure or content of the returned node. The mention of 'expands OBJECT_URI' is vague, and the tool's return value is insufficiently specified.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 100% schema coverage, the baseline is 3. The description restates the parameter names without adding new semantic details beyond the schema's existing descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'Returns' and identifies the resource as 'a node from the in-memory objects list cache', listing the key parameters and mentioning the expansion of OBJECT_URI, which distinguishes it from other retrieval tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies the tool is for cached node retrieval but provides no explicit guidance on when to use it versus alternatives like GetObjectInfo or GetObjectsByType, nor any exclusion criteria.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/fr0ster/mcp-abap-adt'

If you have feedback or need assistance with the MCP directory API, please join our Discord server