Tool Contracts

Overview

A tool contract defines how an MCP tool is called and what it returns.

In Lightcast MCP, contracts are dataset-aware, meaning the valid inputs for a tool can change depending on the selected dataset. The same tool may support different dimensions, metrics, filters, and output structures across datasets.

Tool contracts allow agents to discover supported capabilities at runtime rather than relying on hardcoded request formats.

The safest way to work with tool contracts is to discover them at runtime with tool_info.

Contract Discovery

Use tool_info before calling an analysis tool to retrieve the contract for a specific dataset and tool pair.

{
  "dataset": "job_postings",
  "toolName": "count"
}

The response includes the complete JSON Schema for that combination, including supported dimensions, metrics, filters, operators, required properties, limits, and request structure.

Agents should use the returned schema to construct requests rather than assuming dimensions, metrics, or field names.

Agents should not guess schemas, dimension identifiers, or metric names. Use glossary, tool_info, and classify as discovery steps before running an analysis.


Available Tools

Lightcast MCP currently provides the following tools. Tools

ToolCategoryPurpose
tool_infoAdvisoryReturns the exact JSON Schema for a dataset and analysis tool pair.
classifyResolverResolves raw user text into canonical taxonomy IDs.
countAnalyticsRetrieves counts of records or entities.
distributionAnalyticsReturns distribution buckets or percentile-style spread for a supported metric.
estimateAnalyticsCalculates statistical aggregates or estimated values.
listAnalyticsReturns a granular sample of individual job postings.
timeseriesAnalyticsReturns metric values over time buckets.
topAnalyticsRanks entities within a dimension by a selected metric.
glossaryAdvisoryReturns dataset discovery information.

Inputs

Analysis tools use a shared set of concepts, although availability varies by dataset and tool.

InputDescription
datasetDataset identifier, such as job_postings or profiles.
filterDataset/tool-specific dimension constraints.
metricsMetrics to return for count, estimate, or timeseries.
domainMetricMetric whose distribution is being measured by distribution.
extraMetricsAdditional metrics returned with distribution buckets, where supported.
rankDimensionDimension and level used by top to group rankings.
rankByMetric used by top to order rankings.
fieldsJob posting fields returned by list.
limitMaximum number of records or ranked results, where supported.

Outputs

Tool responses are normalized by tool type.

ToolOutput shape
tool_infoJSON Schema for valid input.
classifyCandidate taxonomy results with ID, name, level, and optional confidence.
count and estimateA metrics object mapping requested metric names to numeric or null values.
distributionA domain and buckets, or year and percentile buckets for government occupations.
listJob posting records and a total result count.
timeseriesInterval, totals, and metric values by time bucket.
topTotals and ranked dimension values.
glossaryMarkdown describing datasets and supported tools.

Validation

Tool contracts are enforced through JSON Schema validation and runtime validation.

Requests may be rejected for reasons such as:

  • Unsupported datasets
  • Unsupported dataset and tool combinations
  • Unsupported dimensions
  • Unsupported metrics
  • Invalid operators
  • Missing required filters
  • Invalid value structures

Structured error responses are returned when validation fails. For error-handling details, see Errors


Did this page help you?