Skip to main content
Glama
jagalliers

appd-mcp

by jagalliers

Get AppDynamics application model

appd_get_application_model

Fetch business transactions, tiers, nodes, and backends for one application in parallel to anchor root cause analysis workflows.

Instructions

Fetch business transactions, tiers, nodes, and backends for one application in parallel. Anchor for nearly all RCA workflows.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
applicationYes
includeNoSubset of model components to fetch (default: all four).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
summaryYes
evidenceNo
entitiesYes
timeRangeNo
sourceEndpointsYes
paginationNo
warningsYes
truncatedYes

Implementation Reference

  • The main tool handler implementation. Defines the ToolRegistration object with name 'appd_get_application_model', wraps the async handler via wrapHandler, fetches business-transactions, tiers, nodes, and backends from the AppDynamics controller API in parallel (concurrency-limited to 4), and returns a structured envelope with all model components.
    export const getApplicationModelTool: ToolRegistration = {
      name: 'appd_get_application_model',
      profile: 'read',
      register(server, services) {
        server.registerTool(
          'appd_get_application_model',
          {
            title: 'Get AppDynamics application model',
            description:
              'Fetch business transactions, tiers, nodes, and backends for one application in parallel. Anchor for nearly all RCA workflows.',
            inputSchema: inputShape,
            outputSchema: envelopeOutputShape,
          },
          wrapHandler<{ application: AppRef; include?: string[] | undefined }, ModelEvidence>(
            services.log,
            'appd_get_application_model',
            async (input) => {
              const include = (input.include ?? ALL_COMPONENTS).filter(
                (c): c is (typeof ALL_COMPONENTS)[number] => (ALL_COMPONENTS as readonly string[]).includes(c),
              );
              const appPath = appRefToPath(input.application);
              const limit = pLimit(4);
              const sourceEndpoints: string[] = [];
    
              const fetchComponent = async <T>(component: (typeof ALL_COMPONENTS)[number]): Promise<T[]> => {
                const path = `applications/${appPath}/${component}`;
                sourceEndpoints.push(`GET /controller/rest/${path}`);
                const res = await services.controller.get<T[]>(path);
                return Array.isArray(res.body) ? res.body : [];
              };
    
              const [bts, tiers, nodes, backends] = await Promise.all([
                include.includes('business-transactions')
                  ? limit(() => fetchComponent<BT>('business-transactions'))
                  : Promise.resolve([] as BT[]),
                include.includes('tiers')
                  ? limit(() => fetchComponent<Tier>('tiers'))
                  : Promise.resolve([] as Tier[]),
                include.includes('nodes')
                  ? limit(() => fetchComponent<Node>('nodes'))
                  : Promise.resolve([] as Node[]),
                include.includes('backends')
                  ? limit(() => fetchComponent<Backend>('backends'))
                  : Promise.resolve([] as Backend[]),
              ]);
    
              const entities: EnvelopeEntity[] = [
                { kind: 'application', id: input.application },
                ...tiers
                  .filter((t): t is Tier & { id: number } => typeof t.id === 'number')
                  .map((t) => ({ kind: 'tier' as const, id: t.id, ...(t.name ? { name: t.name } : {}) })),
                ...nodes
                  .filter((n): n is Node & { id: number } => typeof n.id === 'number')
                  .map((n) => ({ kind: 'node' as const, id: n.id, ...(n.name ? { name: n.name } : {}) })),
              ];
    
              return toToolResult(
                buildEnvelope({
                  summary: `Application model: ${bts.length} BTs, ${tiers.length} tiers, ${nodes.length} nodes, ${backends.length} backends.`,
                  evidence: {
                    application: input.application,
                    bts,
                    tiers,
                    nodes,
                    backends,
                  } as ModelEvidence,
                  entities,
                  sourceEndpoints,
                }),
              );
            },
          ),
        );
      },
    };
  • Input schema definition: expects 'application' (appRefSchema: string name or numeric id) and optional 'include' array selecting which model components to fetch (business-transactions, tiers, nodes, backends).
    const inputShape = {
      application: appRefSchema,
      include: z
        .array(z.enum(['business-transactions', 'tiers', 'nodes', 'backends']))
        .optional()
        .describe('Subset of model components to fetch (default: all four).'),
    };
  • Registration: exported 'getApplicationModelTool' of type ToolRegistration with name 'appd_get_application_model', profile 'read', and a register() method that calls server.registerTool().
    export const getApplicationModelTool: ToolRegistration = {
      name: 'appd_get_application_model',
      profile: 'read',
      register(server, services) {
        server.registerTool(
          'appd_get_application_model',
          {
            title: 'Get AppDynamics application model',
            description:
              'Fetch business transactions, tiers, nodes, and backends for one application in parallel. Anchor for nearly all RCA workflows.',
            inputSchema: inputShape,
            outputSchema: envelopeOutputShape,
          },
          wrapHandler<{ application: AppRef; include?: string[] | undefined }, ModelEvidence>(
            services.log,
            'appd_get_application_model',
            async (input) => {
              const include = (input.include ?? ALL_COMPONENTS).filter(
                (c): c is (typeof ALL_COMPONENTS)[number] => (ALL_COMPONENTS as readonly string[]).includes(c),
              );
              const appPath = appRefToPath(input.application);
              const limit = pLimit(4);
              const sourceEndpoints: string[] = [];
    
              const fetchComponent = async <T>(component: (typeof ALL_COMPONENTS)[number]): Promise<T[]> => {
                const path = `applications/${appPath}/${component}`;
                sourceEndpoints.push(`GET /controller/rest/${path}`);
                const res = await services.controller.get<T[]>(path);
                return Array.isArray(res.body) ? res.body : [];
              };
    
              const [bts, tiers, nodes, backends] = await Promise.all([
                include.includes('business-transactions')
                  ? limit(() => fetchComponent<BT>('business-transactions'))
                  : Promise.resolve([] as BT[]),
                include.includes('tiers')
                  ? limit(() => fetchComponent<Tier>('tiers'))
                  : Promise.resolve([] as Tier[]),
                include.includes('nodes')
                  ? limit(() => fetchComponent<Node>('nodes'))
                  : Promise.resolve([] as Node[]),
                include.includes('backends')
                  ? limit(() => fetchComponent<Backend>('backends'))
                  : Promise.resolve([] as Backend[]),
              ]);
    
              const entities: EnvelopeEntity[] = [
                { kind: 'application', id: input.application },
                ...tiers
                  .filter((t): t is Tier & { id: number } => typeof t.id === 'number')
                  .map((t) => ({ kind: 'tier' as const, id: t.id, ...(t.name ? { name: t.name } : {}) })),
                ...nodes
                  .filter((n): n is Node & { id: number } => typeof n.id === 'number')
                  .map((n) => ({ kind: 'node' as const, id: n.id, ...(n.name ? { name: n.name } : {}) })),
              ];
    
              return toToolResult(
                buildEnvelope({
                  summary: `Application model: ${bts.length} BTs, ${tiers.length} tiers, ${nodes.length} nodes, ${backends.length} backends.`,
                  evidence: {
                    application: input.application,
                    bts,
                    tiers,
                    nodes,
                    backends,
                  } as ModelEvidence,
                  entities,
                  sourceEndpoints,
                }),
              );
            },
          ),
        );
      },
    };
  • The tool is imported from getApplicationModel.ts and included in the ALL_TOOLS array, which is passed to registerTools() for centralized registration with the MCP server.
    import { getApplicationModelTool } from './getApplicationModel.js';
    import { getDependencyMapTool } from './getDependencyMap.js';
    import { getEventsTool } from './getEvents.js';
    import { getHealthRuleViolationsTool } from './getHealthRuleViolations.js';
    import { getMetricHierarchyTool } from './getMetricHierarchy.js';
    import { getTransactionSnapshotsTool } from './getTransactionSnapshots.js';
    import { listApplicationsTool } from './listApplications.js';
    import { listHealthRulesTool } from './listHealthRules.js';
    import { queryAnalyticsEventsTool } from './queryAnalyticsEvents.js';
    import { queryMetricsTool } from './queryMetrics.js';
    
    export const ALL_TOOLS: ToolRegistration[] = [
      listApplicationsTool,
      getApplicationModelTool,
      getMetricHierarchyTool,
      queryMetricsTool,
      getTransactionSnapshotsTool,
      getHealthRuleViolationsTool,
      getAnomalyViolationsTool,
      getEventsTool,
      listHealthRulesTool,
      getAlertingConfigTool,
      queryAnalyticsEventsTool,
      getDependencyMapTool,
    ];
    
    export function registerAllTools(
      server: McpServer,
      services: Services,
    ): { registered: string[]; skipped: string[] } {
      return registerTools(server, services, ALL_TOOLS);
    }
  • wrapHandler utility used to wrap the handler, catching HttpErrors and unexpected errors and converting them to structured error envelopes.
    export function wrapHandler<I, R>(
      log: Logger,
      toolName: string,
      handler: (input: I) => Promise<DualToolResult<R>>,
    ): (input: I) => Promise<DualToolResult<R> | (DualToolResult<R> & { isError: true })> {
      return async (input) => {
        try {
          return await handler(input);
        } catch (err) {
          if (err instanceof HttpError) {
            log.warn(
              {
                tool: toolName,
                kind: err.kind,
                statusCode: err.statusCode,
                sourceEndpoint: err.sourceEndpoint,
              },
              'tool: HttpError',
            );
            return toErrorResult({
              summary:
                `${toolName} failed: ${err.kind}${err.statusCode ? ` (HTTP ${err.statusCode})` : ''}. ${err.hint ?? ''}`.trim(),
              evidence: { kind: err.kind, message: err.message, hint: err.hint } as unknown as R,
              sourceEndpoints: [err.sourceEndpoint],
            });
          }
          log.error({ tool: toolName, err }, 'tool: unexpected error');
          const message = err instanceof Error ? err.message : String(err);
          return toErrorResult({
            summary: `${toolName} failed: unexpected error: ${message}`,
            evidence: { kind: 'internal', message } as unknown as R,
          });
        }
      };
    }
Behavior3/5

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

With no annotations, the description carries full burden. It notes that fetching is done 'in parallel' and for 'one application,' but lacks details on authentication, rate limits, error handling, or what happens if the application does not exist.

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?

Two concise, front-loaded sentences with no wasted words. The purpose and key behavioral trait (parallel fetch) are immediately clear.

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

Completeness4/5

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

Given the presence of an output schema (covering return values), the description is largely complete. It covers the tool's role and core behavior, though it omits potential error scenarios and parameter constraints like case sensitivity.

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?

Schema description coverage is 100% (both parameters have descriptions). The tool description adds no additional nuance beyond the schema, so baseline score of 3 is appropriate.

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 tool fetches business transactions, tiers, nodes, and backends for one application in parallel. It also positions itself as an anchor for RCA workflows, distinguishing it from sibling tools that focus on alerts, metrics, or events.

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 use in RCA workflows but does not explicitly state when to use this tool versus alternatives like appd_get_dependency_map or appd_get_metric_hierarchy. No exclusions or prerequisites are mentioned.

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/jagalliers/appd-mcp'

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