Skip to main content
Glama

record_value_metric

Record workflow value metrics including time saved, risks blocked, success rate, autonomy level, and task complexity for ROI reporting.

Instructions

Record a workflow value metric — tracks time saved, risk blocked, success rate, autonomy level, and task complexity for ROI reporting.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workflow_idYesUnique workflow identifier
workflow_typeYesType of workflow (e.g., claim-analysis, evidence-review, compliance-check)
agent_idYesAgent that performed the workflow
autonomy_levelYesLevel of agent autonomy
measurement_sourceNoHow values were obtainedestimated
time_saved_minutesYesMinutes of human time saved
risk_blocked_countNoNumber of risks/violations blocked
successYesWhether the workflow completed successfully
task_complexityNoTask complexity levelmedium

Implementation Reference

  • The `registerRecordValueMetricTool` function registers the 'record_value_metric' MCP tool. It defines the Zod schema for inputs (workflow_id, workflow_type, agent_id, autonomy_level, measurement_source, time_saved_minutes, risk_blocked_count, success, task_complexity), constructs a ValueMetricEntry, pushes it to an in-memory store, calculates running economic totals (time saved, cost saved, model costs, risks blocked, success rate), emits telemetry via engine.telemetryService.emitToolCall, and returns the recorded metric with running totals.
    export function registerRecordValueMetricTool(server: McpServer, engine: GovernanceEngine): void {
      server.tool(
        'record_value_metric',
        'Record a workflow value metric — tracks time saved, risk blocked, success rate, autonomy level, and task complexity for ROI reporting.',
        {
          workflow_id: z.string().max(100).describe('Unique workflow identifier'),
          workflow_type: z.string().max(100).describe('Type of workflow (e.g., claim-analysis, evidence-review, compliance-check)'),
          agent_id: z.string().max(100).describe('Agent that performed the workflow'),
          autonomy_level: z.enum(['assist', 'delegate', 'automate']).describe('Level of agent autonomy'),
          measurement_source: z.enum(['measured', 'estimated', 'derived']).default('estimated').describe('How values were obtained'),
          time_saved_minutes: z.number().min(0).describe('Minutes of human time saved'),
          risk_blocked_count: z.number().min(0).default(0).describe('Number of risks/violations blocked'),
          success: z.boolean().describe('Whether the workflow completed successfully'),
          task_complexity: z.enum(['low', 'medium', 'high']).default('medium').describe('Task complexity level'),
        },
        { title: 'Record Value Metric', readOnlyHint: false, idempotentHint: false, destructiveHint: false, openWorldHint: false },
        async (input) => {
          try {
            const entry: ValueMetricEntry = {
              workflowId: input.workflow_id,
              workflowType: input.workflow_type,
              agentId: input.agent_id,
              autonomyLevel: input.autonomy_level,
              measurementSource: input.measurement_source,
              timeSavedMinutes: input.time_saved_minutes,
              riskBlockedCount: input.risk_blocked_count,
              success: input.success,
              taskComplexity: input.task_complexity,
              timestamp: new Date().toISOString(),
            };
    
            metricsStore.push(entry);
    
            // Calculate running economic value
            const totalTimeSaved = metricsStore.reduce((sum, m) => sum + m.timeSavedMinutes, 0);
            const totalCostSaved = (totalTimeSaved / 60) * baselines.humanHourlyRate;
            const totalModelCost = metricsStore.length * baselines.modelCostPerRun;
    
            // Tool accountability tracking
            engine.telemetryService.emitToolCall('record_value_metric', `metric-${Date.now().toString(36)}`, 'ADVISORY', true);
    
            return { content: [{ type: 'text' as const, text: JSON.stringify({
              recorded: true,
              workflowId: input.workflow_id,
              metricIndex: metricsStore.length,
              runningTotals: {
                totalMetrics: metricsStore.length,
                totalTimeSavedMinutes: Math.round(totalTimeSaved),
                totalCostSavedUSD: Math.round((totalCostSaved - totalModelCost) * 100) / 100,
                totalRisksBlocked: metricsStore.reduce((sum, m) => sum + m.riskBlockedCount, 0),
                successRate: Math.round((metricsStore.filter(m => m.success).length / metricsStore.length) * 100),
              },
            }, null, 2) }] };
          } catch (error) {
            // Tool accountability tracking
            engine.telemetryService.emitToolCall('record_value_metric', `metric-${Date.now().toString(36)}`, 'ADVISORY', false);
            return { content: [{ type: 'text' as const, text: JSON.stringify({ error: 'RECORD_FAILED', message: String(error) }) }], isError: true };
          }
        }
      );
    }
  • Zod schema for the 'record_value_metric' tool inputs: workflow_id (string max 100), workflow_type (string max 100), agent_id (string max 100), autonomy_level (enum: assist/delegate/automate), measurement_source (enum: measured/estimated/derived, default estimated), time_saved_minutes (number min 0), risk_blocked_count (number min 0, default 0), success (boolean), task_complexity (enum: low/medium/high, default medium).
    {
      workflow_id: z.string().max(100).describe('Unique workflow identifier'),
      workflow_type: z.string().max(100).describe('Type of workflow (e.g., claim-analysis, evidence-review, compliance-check)'),
      agent_id: z.string().max(100).describe('Agent that performed the workflow'),
      autonomy_level: z.enum(['assist', 'delegate', 'automate']).describe('Level of agent autonomy'),
      measurement_source: z.enum(['measured', 'estimated', 'derived']).default('estimated').describe('How values were obtained'),
      time_saved_minutes: z.number().min(0).describe('Minutes of human time saved'),
      risk_blocked_count: z.number().min(0).default(0).describe('Number of risks/violations blocked'),
      success: z.boolean().describe('Whether the workflow completed successfully'),
      task_complexity: z.enum(['low', 'medium', 'high']).default('medium').describe('Task complexity level'),
    },
  • Registration entry in the MCP server's tool table. The `registerValueMetricsTools` function (which includes `registerRecordValueMetricTool`) is listed with tier 'tenant' and description 'value_metrics (record_value_metric, record_governance_event, generate_impact_report)'.
    { tier: 'tenant', register: registerValueMetricsTools, description: 'value_metrics (record_value_metric, record_governance_event, generate_impact_report)' },
  • Import of `registerValueMetricsTools` from './tools/value-metrics.js' in the MCP server, which leads to the registration of the 'record_value_metric' tool.
    import { registerValueMetricsTools } from './tools/value-metrics.js';
  • Telemetry configuration entry for 'record_value_metric': toolClass 'write', riskTier 'low', maiDefault 'INFORMATIONAL', requiresHumanApproval false, category 'metrics'. This defines the tool's governance classification for audit purposes.
    { toolName: 'record_value_metric',    toolClass: 'write',    riskTier: 'low',      maiDefault: 'INFORMATIONAL',  requiresHumanApproval: false, category: 'metrics' },
    { toolName: 'record_governance_event', toolClass: 'write',   riskTier: 'low',      maiDefault: 'INFORMATIONAL',  requiresHumanApproval: false, category: 'metrics' },
Behavior3/5

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

Annotations indicate readOnlyHint=false and destructiveHint=false, consistent with the description. The description adds context that the tool records multiple metrics, but does not disclose idempotency, error handling, or response behavior beyond what annotations provide.

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, front-loaded sentence that immediately states the purpose, followed by specific metrics. It is concise with no superfluous information.

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 tool's complexity (9 parameters, 6 required) and absence of an output schema, the description adequately conveys the purpose and scope. However, it could briefly note the expected return outcome (e.g., success indicator) for full completeness.

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 description adds no significant meaning beyond the schema. The high-level mention of tracked metrics aligns with parameters but does not provide additional context for parameter values or usage.

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 identifies the action ('Record a workflow value metric') and the specific metrics tracked (time saved, risk blocked, success rate, autonomy level, task complexity), distinguishing it from sibling tools like 'record_governance_event' which focus on governance rather than value measurement.

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?

No guidance is provided on when to use this tool versus alternatives such as 'record_governance_event' or other recording tools. The description implies it is for ROI reporting but does not specify exclusivity or prerequisites.

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/knowledgepa3/gia-mcp-server'

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