Skip to main content
Glama
markhilton
by markhilton

cja_create_calculated_metric

Create custom calculated metrics in Adobe Customer Journey Analytics using formulas and functions. Define metric name, formula, type, and polarity for reports.

Instructions

Create a new calculated metric in CJA.

Create a custom metric with formulas and functions that can be used in reports. IMPORTANT: Validate the definition first using cja_validate_calculated_metric.

Args: name: Metric name (required). definition: Metric definition with formula (required). Should have 'func': 'calc-metric', 'formula': {...}, 'version': [1,0,0]. description: Optional metric description. metric_type: Type: 'decimal', 'percent', 'currency', or 'time' (default 'decimal'). polarity: Optional 'positive' or 'negative' (indicates if higher values are better/worse). precision: Optional decimal places for display (0-10). dataview_id: Optional data view ID (uses configured default if not provided).

Returns: Dictionary with created calculated metric details including assigned ID.

Example queries: - "Create a calculated metric named 'Conversion Rate'" - "Make a new metric that divides revenue by orders" - "Create a metric for visits per visitor"

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes
definitionYes
descriptionNo
metric_typeNodecimal
polarityNo
precisionNo
dataview_idNo
Behavior3/5

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

There are no annotations, so the description must disclose behavioral traits. It does state that the tool creates a new metric (mutation) and returns a dictionary with assigned ID, but it does not mention side effects, required permissions, error handling, or rate limits. The important validation note adds some transparency but is not comprehensive.

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

Conciseness4/5

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

The description is well-structured with a concise intro, a highlighted prerequisite, a clear args list, return info, and example queries. It avoids redundant information, though the args list somewhat mirrors the schema. The examples are helpful and efficient.

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 no output schema, the description includes return details and covers all parameters. It mentions validation as a prerequisite and provides example queries. However, it lacks information on error cases, default dataview_id behavior, and authentication requirements, leaving some gaps for a creation tool.

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

Parameters4/5

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

Schema coverage is 0%, so the description must add meaning. It provides context for all 7 parameters: explains name as required, definition structure (func, formula, version), metric_type values, polarity meaning, precision range, and dataview_id optional. This adds significant value beyond the raw schema, though it could include more detail on the formula format.

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 creates a new calculated metric in CJA, specifying it's a custom metric with formulas and functions used in reports. It distinguishes itself from sibling tools like cja_list_calculated_metrics and cja_validate_calculated_metric by focusing on creation.

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 includes an important prerequisite: validating the definition first using cja_validate_calculated_metric. It also provides example queries that illustrate common use cases, guiding the agent on when to use the tool. However, it does not explicitly state when not to use it or provide 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/markhilton/adobe-cja-mcp'

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