Skip to main content
Glama
jagalliers

appd-mcp

by jagalliers

Get AppDynamics transaction snapshots

appd_get_transaction_snapshots

Retrieve slow, error, or diagnostic transaction snapshots for an application. Optionally include exit calls to feed dependency-map analysis.

Instructions

Retrieve slow/error/diagnostic transaction snapshots for an application. Default cap 100, hard max 600. Use needExitCalls=true to feed dependency-map analysis.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
applicationYes
timeRangeNoAppD time range. Defaults to BEFORE_NOW with durationMinutes=30 if omitted by the caller.
businessTransactionIdsNo
tierIdsNo
nodeIdsNo
slowOnlyNoOnly include snapshots flagged slow (deep-dive eligible).
errorOnlyNoOnly include snapshots with errors.
firstInChainNoOnly return originating snapshots (not children).
needExitCallsNoInclude exit calls (DB/HTTP/queue) per snapshot. Required for dependency-map synthesis.
needPropsNoInclude data-collector property fields per snapshot.
maxResultsNoHow many snapshots to request (default 100, max 600 per docs).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
summaryYes
evidenceNo
entitiesYes
timeRangeNo
sourceEndpointsYes
paginationNo
warningsYes
truncatedYes

Implementation Reference

  • The async handler function that executes the tool logic: builds query parameters, calls the controller API at /request-snapshots, and returns a formatted envelope with snapshot data and warnings.
    >(services.log, 'appd_get_transaction_snapshots', async (input) => {
      const tr = input.timeRange ?? DEFAULT_TIME_RANGE;
      const params = applyTimeRangeToParams(tr);
      const max = input.maxResults ?? SNAPSHOT_DEFAULT;
      params.append('maximum-results', String(max));
    
      if (input.businessTransactionIds?.length) {
        for (const id of input.businessTransactionIds)
          params.append('business-transaction-ids', String(id));
      }
      if (input.tierIds?.length) {
        for (const id of input.tierIds) params.append('application-component-ids', String(id));
      }
      if (input.nodeIds?.length) {
        for (const id of input.nodeIds) params.append('application-component-node-ids', String(id));
      }
      if (input.slowOnly !== undefined)
        params.append('user-experience', input.slowOnly ? 'SLOW' : 'NORMAL');
      if (input.errorOnly !== undefined) params.append('error-occurred', String(input.errorOnly));
      if (input.firstInChain !== undefined) params.append('first-in-chain', String(input.firstInChain));
      if (input.needExitCalls) params.append('need-exit-calls', 'true');
      if (input.needProps) params.append('need-props', 'true');
    
      const appPath = appRefToPath(input.application);
      const path = `applications/${appPath}/request-snapshots`;
      const res = await services.controller.get<Snapshot[]>(path, Object.fromEntries(params));
      const snapshots = Array.isArray(res.body) ? res.body : [];
    
      const warnings = timeRangeWarnings(tr);
      const truncated = snapshots.length >= max && max < SNAPSHOT_HARD_CAP;
      if (truncated) {
        warnings.push(
          `Got exactly maxResults (${max}) snapshots — there may be more. Increase maxResults (cap ${SNAPSHOT_HARD_CAP}) or narrow the time window.`,
        );
      }
    
      return toToolResult(
        buildEnvelope({
          summary: `${snapshots.length} snapshot${snapshots.length === 1 ? '' : 's'} returned.`,
          evidence: {
            application: input.application,
            count: snapshots.length,
            snapshots,
          } as SnapshotsEvidence,
          entities: [{ kind: 'application', id: input.application }],
          timeRange: toEnvelopeTimeRange(tr),
          sourceEndpoints: [`GET /controller/rest/${path}`],
          warnings,
          truncated,
        }),
      );
    }),
  • Input schema definition using Zod: validates application, timeRange, businessTransactionIds, tierIds, nodeIds, slowOnly, errorOnly, firstInChain, needExitCalls, needProps, and maxResults.
    const inputShape = {
      application: appRefSchema,
      timeRange: timeRangeSchema.optional(),
      businessTransactionIds: z.array(z.number().int().positive()).optional(),
      tierIds: z.array(z.number().int().positive()).optional(),
      nodeIds: z.array(z.number().int().positive()).optional(),
      slowOnly: z.boolean().optional().describe('Only include snapshots flagged slow (deep-dive eligible).'),
      errorOnly: z.boolean().optional().describe('Only include snapshots with errors.'),
      firstInChain: z.boolean().optional().describe('Only return originating snapshots (not children).'),
      needExitCalls: z
        .boolean()
        .optional()
        .default(false)
        .describe('Include exit calls (DB/HTTP/queue) per snapshot. Required for dependency-map synthesis.'),
      needProps: z
        .boolean()
        .optional()
        .default(false)
        .describe('Include data-collector property fields per snapshot.'),
      maxResults: z
        .number()
        .int()
        .positive()
        .max(SNAPSHOT_HARD_CAP)
        .optional()
        .default(SNAPSHOT_DEFAULT)
        .describe(
          `How many snapshots to request (default ${SNAPSHOT_DEFAULT}, max ${SNAPSHOT_HARD_CAP} per docs).`,
        ),
    };
  • ToolRegistration object that defines the tool name 'appd_get_transaction_snapshots', profile 'read', and the register() function that calls server.registerTool with name, config, and handler.
    export const getTransactionSnapshotsTool: ToolRegistration = {
      name: 'appd_get_transaction_snapshots',
      profile: 'read',
      register(server, services) {
        server.registerTool(
          'appd_get_transaction_snapshots',
          {
            title: 'Get AppDynamics transaction snapshots',
            description: `Retrieve slow/error/diagnostic transaction snapshots for an application. Default cap ${SNAPSHOT_DEFAULT}, hard max ${SNAPSHOT_HARD_CAP}. Use needExitCalls=true to feed dependency-map analysis.`,
            inputSchema: inputShape,
            outputSchema: envelopeOutputShape,
          },
          wrapHandler<
            {
              application: AppRef;
              timeRange?: TimeRange | undefined;
              businessTransactionIds?: number[] | undefined;
              tierIds?: number[] | undefined;
              nodeIds?: number[] | undefined;
              slowOnly?: boolean | undefined;
              errorOnly?: boolean | undefined;
              firstInChain?: boolean | undefined;
              needExitCalls?: boolean | undefined;
              needProps?: boolean | undefined;
              maxResults?: number | undefined;
            },
            SnapshotsEvidence
          >(services.log, 'appd_get_transaction_snapshots', async (input) => {
            const tr = input.timeRange ?? DEFAULT_TIME_RANGE;
            const params = applyTimeRangeToParams(tr);
            const max = input.maxResults ?? SNAPSHOT_DEFAULT;
            params.append('maximum-results', String(max));
    
            if (input.businessTransactionIds?.length) {
              for (const id of input.businessTransactionIds)
                params.append('business-transaction-ids', String(id));
            }
            if (input.tierIds?.length) {
              for (const id of input.tierIds) params.append('application-component-ids', String(id));
            }
            if (input.nodeIds?.length) {
              for (const id of input.nodeIds) params.append('application-component-node-ids', String(id));
            }
            if (input.slowOnly !== undefined)
              params.append('user-experience', input.slowOnly ? 'SLOW' : 'NORMAL');
            if (input.errorOnly !== undefined) params.append('error-occurred', String(input.errorOnly));
            if (input.firstInChain !== undefined) params.append('first-in-chain', String(input.firstInChain));
            if (input.needExitCalls) params.append('need-exit-calls', 'true');
            if (input.needProps) params.append('need-props', 'true');
    
            const appPath = appRefToPath(input.application);
            const path = `applications/${appPath}/request-snapshots`;
            const res = await services.controller.get<Snapshot[]>(path, Object.fromEntries(params));
            const snapshots = Array.isArray(res.body) ? res.body : [];
    
            const warnings = timeRangeWarnings(tr);
            const truncated = snapshots.length >= max && max < SNAPSHOT_HARD_CAP;
            if (truncated) {
              warnings.push(
                `Got exactly maxResults (${max}) snapshots — there may be more. Increase maxResults (cap ${SNAPSHOT_HARD_CAP}) or narrow the time window.`,
              );
            }
    
            return toToolResult(
              buildEnvelope({
                summary: `${snapshots.length} snapshot${snapshots.length === 1 ? '' : 's'} returned.`,
                evidence: {
                  application: input.application,
                  count: snapshots.length,
                  snapshots,
                } as SnapshotsEvidence,
                entities: [{ kind: 'application', id: input.application }],
                timeRange: toEnvelopeTimeRange(tr),
                sourceEndpoints: [`GET /controller/rest/${path}`],
                warnings,
                truncated,
              }),
            );
          }),
        );
      },
    };
  • Central registration: ALL_TOOLS array includes getTransactionSnapshotsTool, and registerAllTools delegates to registerTools which iterates and calls each tool's register method.
    export function registerAllTools(
      server: McpServer,
      services: Services,
    ): { registered: string[]; skipped: string[] } {
      return registerTools(server, services, ALL_TOOLS);
    }
  • wrapHandler function used by the tool to catch HttpErrors and unexpected errors, returning structured error envelopes instead of crashing.
    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?

No annotations are provided, so the description carries the disclosure burden. It mentions default cap and hard max, which are behavioral, but does not disclose authentication, side effects, or rate limits. The presence of an output schema partially compensates, but more context would be helpful.

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 consists of two concise sentences with no fluff. It front-loads the purpose and immediately follows with important limits and a usage hint.

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

Completeness3/5

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

Given the tool has 11 parameters and no annotations, the description is too brief. It covers purpose and one usage tip, but lacks guidance on filters, time range options, and how it fits with siblings like appd_get_dependency_map. The output schema exists but is not referenced.

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 64%, and the description only adds meaning for the 'needExitCalls' parameter. Other parameters like timeRange and filters are well-documented in the schema, but the description does not highlight them. It adds modest value beyond the schema.

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 'Retrieve' and the resource 'slow/error/diagnostic transaction snapshots for an application', distinguishing it from sibling tools like appd_get_dependency_map or appd_query_metrics.

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

Usage Guidelines4/5

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

The description provides specific guidance: 'Default cap 100, hard max 600. Use needExitCalls=true to feed dependency-map analysis.' It tells when to use a key parameter but lacks explicit when-not-to-use or comparison with alternatives.

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