Skip to main content
Glama
vikranthviki

Causal Decision Agent

by vikranthviki

diversity_index

Read-only

Compute species-diversity indices (Shannon, Simpson, Hill numbers, richness, evenness) from record or count data, with grouping and small-sample filtering for ecological outcome analysis.

Instructions

Species-diversity indices from record-level or count data: Shannon entropy, species richness, Pielou evenness, the Simpson family (concentration / Gini-Simpson / inverse) and Hill numbers of any order. Accepts long-format sighting records or a site-by-species matrix and groups straight onto a panel index, so an ecological outcome can be built inside the same pipeline that estimates on it. min_records makes the small-sample filter explicit rather than a footnote.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
qNoHill number order
byNoGrouping keys, typically the panel index
baseNoLog base for Shannon
countNoAbundance column; omit when one row is one record
indexNoIndex/indices to compute, or 'all'shannon
detailNoPayload depth: 'minimal' (~150 tokens) for sub-step calls where only the point estimate is needed; 'standard' (~1K tokens) for diagnostics + coefficient table; 'agent' (~2K tokens, default) adds violations / next_steps / suggested_functions so the LLM can plan its next call without another round-trip.agent
speciesNoSpecies column (required for long-format input)
as_handleNoIf true, cache the fitted result on the server and return result_id + result_uri alongside the JSON payload so a subsequent tools/call can chain without re-running.
data_pathYesAbsolute path or URL to a data file. Supported: .csv / .tsv / .txt (delimited), .parquet / .pq, .feather / .arrow, .xlsx / .xls, .dta (Stata), .json / .jsonl. Schemes: file://, s3://, gs://, https://.
result_idNoOptional handle to a previously-fitted result (returned by an earlier call when as_handle=true). Tools that operate on a fitted object accept this in place of re-supplying data_path + columns.
min_recordsNoGroups below this many records return NaN
data_columnsNoOptional column projection. Parquet/Feather/Stata loaders honour this for fast partial reads.
data_sample_nNoOptional uniform random subsample size (seed=0, deterministic) — useful on huge panels.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/5.0
Behavior4/5

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

readOnlyHint=true already signals a read-only operation, and the description complements this by disclosing behavior: it accepts two input shapes, groups onto a panel index, and applies an explicit min_records small-sample filter. There is no contradiction with the annotations.

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?

Three sentences with no filler: the indices are named up front, input formats and pipeline integration follow, and the min_records note ends with a useful detail. The description is front-loaded and every sentence earns its place.

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?

For a 13-parameter tool with a rich output schema and read-only annotation, the description covers the essential modes: record-level data, count data, matrix input, grouping, and small-sample filtering. An explicit pointer to when related inequality measures should be used instead would make it fully complete.

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 coverage is 100%, and the schema already documents parameters like q, index, detail, and data_path with meaningful descriptions. The description's only parameter-level addition is highlighting min_records as a small-sample filter, which is useful but not essential for calling the tool correctly.

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 states a specific verb and resource: it computes species-diversity indices and enumerates exactly which ones (Shannon, richness, Pielou, Simpson family, Hill numbers). This makes the tool instantly distinguishable from broad siblings like regress or inequality_index.

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

Usage Guidelines3/5

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

It gives useful input-mode context (long-format sighting records vs site-by-species matrix) and mentions grouping onto a panel index, so an agent can infer common use cases. However, it never explicitly contrasts it with related distributional tools such as inequality_index or states when not to use it, leaving selection partially to inference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools