Skip to main content
Glama

transform_card

Transform Adaptive Cards by upgrading or downgrading versions, applying host-specific constraints, or flattening nested structures for compatibility across platforms.

Instructions

Transform an Adaptive Card: upgrade/downgrade version, apply host-specific constraints, or flatten nesting.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cardYesThe Adaptive Card JSON object or cardId to transform
transformYesThe type of transformation to apply
targetVersionNoTarget version for upgrade/downgrade (e.g., "1.3", "1.5", "1.6")
targetHostNoTarget host

Implementation Reference

  • Main handler function for the 'transform_card' tool, which dispatches to sub-functions based on the requested transform type.
    export function handleTransformCard(input: TransformCardInput): TransformCardOutput {
      const { card, transform, targetVersion, targetHost } = input;
    
      const result = JSON.parse(JSON.stringify(card)) as Record<string, unknown>;
      const changes: string[] = [];
      const warnings: string[] = [];
    
      switch (transform) {
        case "upgrade-version":
          upgradeVersion(result, targetVersion || "1.6", changes, warnings);
          break;
        case "downgrade-version":
          downgradeVersion(result, targetVersion || "1.3", changes, warnings);
          break;
        case "apply-host-config":
          applyHostConfig(result, targetHost || "teams", changes, warnings);
          break;
        case "flatten":
          flattenCard(result, changes, warnings);
          break;
      }
    
      return { card: result, changes, warnings };
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions what transformations are possible but doesn't describe important behavioral aspects: whether transformations are reversible, what happens to unsupported features during version changes, whether host constraints might remove card elements, or what the output format looks like. For a tool that modifies structured data, this is insufficient.

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 extremely concise - a single sentence that efficiently lists the three transformation capabilities. Every word earns its place with zero wasted text. The structure is front-loaded with the core purpose immediately clear.

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?

For a tool with 4 parameters, no annotations, and no output schema, the description is incomplete. It doesn't explain what the transformed output looks like, what validation occurs, whether transformations preserve all card functionality, or how errors are handled. The description provides only surface-level information about transformation types.

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%, so the schema already documents all parameters thoroughly. The description mentions the transformation types that correspond to the 'transform' enum values, but doesn't add meaningful semantic context beyond what's in the schema descriptions. Baseline 3 is appropriate when the schema does the heavy lifting.

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

Purpose4/5

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

The description clearly states the tool transforms Adaptive Cards with specific operations (upgrade/downgrade version, apply host-specific constraints, flatten nesting). It uses a specific verb ('transform') and resource ('Adaptive Card'), but doesn't explicitly distinguish from sibling tools like 'optimize_card' or 'template_card' that might also modify cards.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. With multiple sibling tools that manipulate cards (optimize_card, template_card, validate_card, etc.), there's no indication of when transformation is appropriate versus other operations like generation or validation.

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/VikrantSingh01/adaptive-cards-mcp'

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