Skip to main content
This page lists every customer-visible tool that the Leaf MCP server exposes to AI assistants, grouped by category. Tools use the OAuth session that your MCP client establishes. Your MCP client lists only the tools that your project’s plan and your role allow. For details, see Access and projects. For setup instructions, see MCP Server Overview. Most tools only read data. The field set, file tracker, and region tools also create and update saved items, and select_project saves your active project. No tool deletes a field set, file tracker, or region, but updates can remove fields from a set, replace a tracker’s columns, or clear a region’s description and tags.

Documentation

get_docs_index

Lists the current public Leaf documentation pages. Each line’s path is a valid doc_path for get_leaf_doc.

get_leaf_doc

Returns one page of the current Leaf documentation at https://docs.withleaf.io.

Projects

These tools show your account context and switch the project that Leaf API calls use.

list_projects

Lists the projects in your organization. Each item is {id, username, selected}. selected marks the project that Leaf API calls use.

select_project

Switches Leaf API calls to another project in your organization. The selection is saved to your Leaf login, so the Leaf dashboard switches to the same project. If you select the project that’s already active, the tool returns {"selectedApiOwner": null}.

clear_project

Drops a project override that is local to this session and returns to your login’s project. It doesn’t undo a selection that select_project saved. To switch back, call select_project with the original project’s ID.

get_account_context

Returns the active project’s username (selectedApiOwner) and the signed-in user. selectedApiOwner is a username, not an ID; to switch projects, use an id from list_projects. The entitlement field is always null and is deprecated. A later release removes it.

get_org_context

Returns the organization (org), the active project (api_owner), the signed-in person (person), and dashboard links (links). The response includes these sections only when your role allows them:
  • providers (the configured providers) and links.integrations require providers.view.
  • pipeline (the project’s pipeline configuration) and links.pipeline require pipeline.view.
Without those permissions, you can still call the tool; it omits those sections. A provider that can’t be checked is left out of providers instead of failing the call. The permissions field is always null and is deprecated. A later release removes it.

Deprecated aliases

These tools use the earlier “API owner” names. They behave like the project tools that replace them, and they remain available until a later release.

Growers

Grower summaries include leaf_user_id, name, email, external_id, provider_refs, and a dashboardUrl that opens the grower in the Leaf dashboard. Growers shared with your account are included.

search_growers

Finds growers by name, Leaf user ID, provider grower ID, or email, and returns a ranked list, best match first. Matches rank in this order:
  1. An exact Leaf user ID, provider grower ID, or provider organization ID.
  2. A grower name or provider grower name that equals the query, contains it, is within one edit of it, or contains a run of words within one edit of it.
  3. A Leaf user ID or provider ID that starts with the query.
When the query looks like an ID (hex digits and dashes), ID-prefix matches rank above name matches. One-edit and prefix matches need at least four letters or digits. A grower’s own name outranks the same kind of match on a provider grower name. A query that contains @ runs a fuzzy email search instead, which isn’t ranked. The response is {results, page, size, totalElements, totalPages, truncated}. Each result is a grower summary plus these fields:
  • match: why the grower matched, as {on, value, tier, rank, score}. on is id, name, providerGrowerId, providerOrganizationId, or providerGrowerName. tier is 0 for an exact ID, 1 for an exact name, 2 for contains, 3–4 for one edit, and 5 for an ID prefix. rank is the overall position, where 1 is best.
  • exact_match: true for an exact ID or name, the grower’s own or a provider’s.
truncated is true when more matches exist than were returned. If a query of several words matches nothing, the server retries once with its most distinctive word and adds retried_with to the response. If ranked search is unavailable, the response includes fallback: "name_only" and matches Leaf user names only. Several growers can share a name. Treat a result as the grower you meant only when it’s the single exact_match.

list_growers

Lists your account’s growers by name and returns the total count. The tool returns the first page only and has no paging parameter. The response is {results, page, size, totalElements, totalPages, truncated}. When truncated is true, totalElements holds the total number of growers. To see more, call again with a larger limit. To find a grower beyond the first 100, use search_growers.

get_grower

Returns a grower summary and dashboardUrl. Optional includes add related context. Each include returns the following:
  • fields: the first five fields. Requires fields.view.
  • providers: the latest credential event status of each provider. Requires providers.view.
  • files: file counts by status. Requires files.view.
  • pipeline: the grower’s processing configuration. Requires pipeline.view.

Fields

Field summaries include field_id, leaf_user_id, name, providerFieldName, providerFieldId, provider, acres, area, dashboardUrl, and exploreUrl. The server computes acres from the field’s area, so you don’t need a unit conversion to report it; it’s null when the field has no area. dashboardUrl opens the field page in the Leaf dashboard, and exploreUrl opens the field in Explore.

list_fields

Returns the first page of field summaries for a grower. To use more criteria, sorting, or later pages, use search_fields.

search_fields

Finds fields by name or ID, best match first, or lists fields by filters. At least one of leaf_user_id, query, field_id, field_ids, or provider_field_id is required. With query, the server runs one ranked search and returns the best limit matches. Matches rank in this order:
  1. A field ID or provider field ID that equals the query.
  2. A field name or provider field name that equals the query, contains it, is within one edit of it, or contains a run of words within one edit of it.
  3. A field ID that starts with the query (four or more hex digits), or a provider field ID that starts with it (four or more characters).
When the query looks like an ID (hex digits and dashes), ID-prefix matches rank above name matches. A field’s own ID and name outrank the same kind of match on its provider field ID and name. To look up a field by ID, pass the field UUID as query. In a ranked search, page must be 0, sort_by and sort_direction are ignored, and you can’t combine query with provider_field_id. The other filters narrow the results. Each ranked result adds these fields to the field summary:
  • growerName: the grower’s name. It’s null when the grower lookup fails or times out, or when the grower is past the first 25 growers in the results.
  • match: why the field matched, as {on, value, tier, rank, score}. on is id, name, providerFieldId, or providerFieldName. tier is 0 for an exact ID, 1 for an exact name, 2 for contains, 3–4 for one edit, and 5 for an ID prefix. rank is the overall position, where 1 is best.
  • exact_match: true for an exact ID or name, the field’s own or the provider’s.
A ranked response also includes truncated, which is true when more matches exist than were returned. Field names repeat across growers. Treat a result as the field you meant only when it’s the single exact_match. Without query, the tool filters fields by identity, status, provider, time, or operation criteria, and pages and sorts the results. Results default to most recently updated first. The response is {results, page, size, totalElements, totalPages}. All related-operation filters require leaf_user_id. If you supply both provider and operation_provider, they must match. Each time-range start must not be later than its end.

get_field

Returns a field summary with dashboardUrl and exploreUrl. Optional includes add operations, boundary records, or active geometry.

Field finding and spatial

These tools find growers and fields by name, ID, operation history, or location.

search_best

Finds growers and fields by one name and ranks them together, best match first. Use it when you have a name but don’t know whether it’s a grower or a field. The tool searches the whole text as one name. For a request like “field X of grower Y,” call search_growers for Y and then search_fields for X. For a full UUID, use resolve_id. For an email, use search_growers. The response is {items, growers_total, fields_total, truncated}. Each item is a search_growers result with entity_type: "grower" or a search_fields result with entity_type: "field", including match and exact_match. If the grower search used retried_with or fallback, the response passes it through.

resolve_id

Identifies what a Leaf ID refers to: a grower, field, operation, file, or upload batch. The tool looks up the ID as every requested type at once. The response is {id, matches, notFound, errors}. Each match is {entityType, id, name, leafUserId, summary}, where summary is the object that the matching get tool returns. notFound lists the types that have no record with this ID. errors lists lookups that failed, so those types are unknown rather than absent.

fields_with_operation

Checks which fields have at least one operation of one type, optionally in a time window. The tool checks each field separately. A failed lookup on one field is reported on that field and doesn’t fail the others. The response is {operationType, window, results, withOperation, withoutOperation, failed}. Each result is {fieldId, leafUserId, name, dashboardUrl, exploreUrl, hasOperation, count, latestOperationId, latestStartTime}, in input order. window is {startTime, endTime, endTimeCapped}.

fields_overlapping

Finds fields whose boundary overlaps one reference shape. Give exactly one reference: field_id, field_name, or region_id. There’s no bulk mode; to compare many fields, call the tool once for each reference field. The tool compares active field boundaries, and coordinates don’t leave the server. The response is {reference, scope, fields, count, matchedCount, truncated}. Each field includes fieldId, leafUserId, growerName, name, providerFieldName, dashboardUrl, exploreUrl, label, iou, referenceShare, candidateShare, overlapAreaM2, and candidateAreaM2. label is one of the following:
  • duplicate: intersection over union (iou) is 0.9 or more.
  • inside: the field is smaller, and at least 80% of it lies in the reference.
  • contains: the reference is smaller, and at least 80% of it lies in the field.
  • overlaps: any other overlap.
Areas are in square meters. The reference field is never listed. A field_name that matches several fields returns an invalid_request error with the key ambiguous_reference and the candidates. A reference field without an active boundary returns not_found with the key no_boundary.

fields_nearby

Finds fields within a distance of one reference shape, nearest first, and flags adjacent ones. Give exactly one reference, as for fields_overlapping: field_id, field_name, or region_id. Distance is the shortest edge-to-edge distance between active boundaries, so overlapping and touching fields have a distance of 0. There’s no bulk mode. The response is {reference, scope, distanceM, fields, count, matchedCount, truncated}. Each field includes fieldId, leafUserId, growerName, name, providerFieldName, dashboardUrl, exploreUrl, distanceM, and adjacent. adjacent is true within 5 meters (shared or touching edges). The reference field is never listed.

Field operations

Operation summaries include operation_id, field_id, field_ids, leaf_user_id, type, status, time_range, and a dashboardUrl that opens the operation in the Leaf dashboard.

list_operations

Lists the operations of a grower, field, file, or zone, sorted on the server. Results default to most recent operation start time first. At least one of leaf_user_id, field_id, file_id, or zone_id is required. The response is {results, page, size, totalElements, totalPages, window}. When totalElements is larger than the number of results, the list is partial. window is {startTime, endTime, endTimeCapped} as sent to the operations service. To read an operation’s statistics, call get_operation with include: ["summary"]. For example, to find the most recent harvest operations for a grower, call list_operations with leaf_user_id, operation_type: "harvested", sort_by: "start_time", and sort_direction: "desc". The API applies the sort before pagination, so page zero contains the newest matching records.

get_operation

Returns the operation’s core metadata and dashboardUrl. Optional includes add summary statistics, units, downloadable operation data, image metadata, or source-file references. Each include returns the following:
  • summary: the properties of the operation’s summary GeoJSON, without its geometry. Properties include totalArea, startTime, endTime, crop, operationType, per-property statistics as {avg, min, max, unit}, totals such as totalApplied, varieties on planted and harvested operations, products on applied operations, and machinery. Each value carries its unit; to convert it, use get_unit_conversion_factor.
  • units: the unit of each property.
  • geojson or geoparquet: a short-lived downloadUrl and an imageRecipe. Requires operations.export.
  • images: at most 20 image metadata records and a truncation indicator, not private image bytes.
  • files: the operation’s source files. Requires files.view. The automerged file that the operation was built from isn’t among them; to find it, call get_file on a source file with include: ["mergedFile"].
Request at most one of geojson, geoparquet, or images in a call. geojson and geoparquet return a short-lived downloadUrl instead of a private upstream URL. The link lasts for at most ten minutes and never outlives the access token that authorized it. Both geojson and geoparquet results include an imageRecipe for client-side rendering. The recipe tells the assistant to load the file, select a numeric measurement, apply a continuous color scale, and optionally fetch associated field geometry with get_field using leaf_user_id and field_id for a boundary overlay. For GeoParquet, geometry and CRS come from the file metadata and the measurement is a column. For GeoJSON, coordinates are longitude and latitude and the measurement is a feature property. Request units in the same call to include measurement-unit hints in the recipe; otherwise it provides the follow-up get_operation call. The MCP server doesn’t download or render the image itself.

Machine files

Machine files are the raw data files that Leaf processes into standardized field operations. File summaries include these fields:
  • file_id, name, status, leaf_user_id, size, and updated_at.
  • type: the detected file format, for example ADAPTADM.
  • origin: provider (synced from a provider), uploaded (from an upload batch), merged (a manual merge), or automerged (Leaf merged several files of one operation).
  • operation_type: the operation type of the file.
  • batch_id: the upload batch the file came from, if any.
  • source_files: the file IDs that a merged or automerged file was built from. It’s empty for any other file.
  • dashboardUrl: opens the file in the Leaf dashboard.

list_files

Returns machine-file summaries. The field-scoped route doesn’t support status. If you pass both field_id and status, the tool returns invalid_request.

get_file

Returns a machine-file summary. Optional includes add summary data, units, processing errors, the automerged file, or the raw record. An operation is built from its automerged file. A source file can be processed while the operation is missing data because the automerged file failed. Each include returns the following:
  • summary: the properties of the file’s summary GeoJSON, without its geometry, in the same shape as an operation summary.
  • units: the unit of each property.
  • errors: the status of each pipeline step, as {<step>: {status, message}}. A step that didn’t run because an earlier step failed has status failed and message skipped. The cause is the earliest step in pipeline order that failed with any other message.
  • mergedFile: for a source file, {merged_file, scanned, truncated}. merged_file is the summary of the automerged file that this file fed, or null if none was found. The search covers the grower’s automerged files updated since this file was created and stops after 300 files. When truncated is true, a null merged_file isn’t conclusive. For a merged or automerged file, merged_file is null and scanned is 0; read its source_files instead.
  • raw: the file record as the operations service returns it.

Batch uploads

An upload batch is one archive that a user uploaded. Leaf splits it into machine files and converts each one.

list_batches

Returns a paginated list of manual-upload batches.

get_batch

Returns a summary of one upload batch: {batch_id, leaf_user_id, file_name, provider, status, status_details, upload_timestamp, size}. status is one of the following:
  • RECEIVED: processing hasn’t finished.
  • PROCESSED: at least one file converted.
  • FAILED: no file converted. status_details says why.
To see what happened to each file, use get_batch_status.

get_batch_status

Explains what happened to each file in an upload batch. The response is {batch, converted, processing, failed, files_listed, truncated}:
  • batch: the same summary that get_batch returns.
  • converted and processing: lists of file summaries.
  • failed: one entry per pipeline step and message, as {step, message, files}. For example, step might be standardGeojson with the message no points passed the filter, followed by the files that failed there.
  • files_listed: the number of the batch’s files read, at most 100.
  • truncated: true when the batch status names files that the listing didn’t return. Those files carry only file_id.

Field sets

A field set is a saved list of fields. These tools read, create, and update field sets. They don’t delete field sets. Only the creator of a set can change it. Field sets include a dashboardUrl that opens the set in the Leaf dashboard.

list_field_sets

Lists the field sets you can read. Each row includes the ID, name, description, visibility, revision, entry count, and dashboardUrl, but not the fields in the set. When hasMore is true, call again with the next page and pass the returned size as limit.

get_field_set

Returns one field set: its ID, name, description, visibility, revision, entry count, dashboardUrl, and entries. Each entry has fieldId, leafUserId, and label.

create_field_set

Creates a field set and stores the given fields. It doesn’t update an existing set. Fields past the set’s entry cap are left out and counted in omitted.

add_fields_to_field_set

Appends fields to a field set that you created. Existing fields stay, including their tags, notes, and metadata. Fields already in the set are counted in alreadyPresent and aren’t written again. Fields past the entry cap are counted in omitted.

update_field_set

Changes a field set’s name, description, or visibility, or removes fields from it. Omit a value to leave it unchanged. Removing fields leaves every other field, tag, note, and metadata value in place.

add_grower_fields

Appends every field of one grower to a field set that you created. The tool reads the grower’s fields 100 at a time, for at most five pages. Fields already in the set are skipped and counted in alreadyPresent. A field that would exceed the set’s entry cap is left out and counted in remainder. If the grower has more fields than five pages hold, the tool writes nothing, sets scannedIncomplete to true, and counts the new fields it saw in remainder. In that case, add the fields with add_fields_to_field_set. When nothing new fits, the set doesn’t change.

File trackers

A file tracker definition describes which files you expect for a set of fields, organized in columns. These tools read, create, and update file tracker definitions. They don’t delete them. File trackers include a dashboardUrl that opens the tracker in the Leaf dashboard.

list_file_trackers

Lists the file tracker definitions you can see. Each row includes the ID, name, visibility, revision, description, column count, and dashboardUrl. To read the columns, use get_file_tracker.

get_file_tracker

Returns one file tracker definition, including its columns and revision.

create_file_tracker

Creates a file tracker definition. Each column needs a UUID id, a label, an eventType, a match mode, and startDate and endDate in YYYY-MM-DD format. The following rules apply to columns:
  • eventType is planting, application, harvest, or tillage.
  • Planting and harvest columns allow the match modes any, crop, and crop-and-variety. Application columns allow any, product-class, and specific-products. Tillage columns allow any.
  • criteria, a list of {"id", "label"} objects, is required unless the match mode is any. varietyCriteria is required only for crop-and-variety.
  • required is an optional boolean (default true).
  • A tracker has at most 30 columns, and each column’s criteria and varietyCriteria lists hold at most 50 items each.
limiter is null (every field), {"type": "grower", "growerIds": [...]} with 1 to 200 grower IDs, or {"type": "field-set", "fieldSetId": ...}. Common column layouts include the following:
  • Row-crop season: planting (any), application (product-class, criterion ID fertilization), and harvest (any).
  • Crop protection: two application columns, product-class herbicide and fungicide.
  • Tillage baseline: one tillage column with any.
  • Blank: one planting column with any.

update_file_tracker

Replaces a file tracker definition and keeps any value that the call omits. Omitting a value or passing null keeps the stored value. The column and limiter rules are the same as for create_file_tracker. Pass the revision that you last read. If the tracker changed since then, the update is rejected; read it again with get_file_tracker and retry.

Regions

A region is a saved area, stored as a GeoJSON MultiPolygon. These tools read, create, and update regions. They don’t delete them. A region’s dashboardUrl opens the regions page in the Leaf dashboard.

list_regions

Lists the saved regions you can see, so you can find one by name and get its ID. The response is {regions: [{id, name, type, shared, dashboardUrl}], count}. A count of 0 means you have no saved regions, or none match.

get_region

Returns one saved region as {id, name, type, shared, metadata, dashboardUrl}. metadata.geometry holds the region’s MultiPolygon.

create_region

Saves a region and returns {id, name, type, shared, dashboardUrl}. geometry must be a GeoJSON MultiPolygon with closed rings that you supplied or read from get_region.

update_region

Changes a saved region and returns {id, name, type, shared, metadata, dashboardUrl}. Omit a value to leave it unchanged. The tool reads the region and writes the merged metadata. geometry, when present, must be a MultiPolygon with closed rings.

list_fields_in_region

Lists one grower’s fields whose boundaries intersect a saved region. The tool runs the same query as the region field list in the Leaf dashboard. The response is {fields: [{fieldId, leafUserId, dashboardUrl, exploreUrl}], count, matchedCount, truncated}. fields holds at most 500 entries, the field set limit. truncated is true when matchedCount is larger. To add the fields to a field set, pass each one to add_fields_to_field_set as {field_id: fieldId, leaf_user_id: leafUserId, label}. Entries don’t carry a name, so use the field name from search_fields as the label when you know it, otherwise the field ID.

Support and troubleshooting

These tools help you diagnose missing, failed, or unexpected data, and draft a support request. To follow Leaf’s built-in troubleshooting procedures, start with search_knowledge, described in Knowledge.

get_file_lineage

Traces one machine file to everything derived from it: the merged file, operations, fields, and grower. A source file (origin provider or uploaded) is merged by Leaf into an automerged file, which builds the operation. The response is {file, source_files, merged_file, merged_scan, operations, operations_total, fields, grower}:
  • file: the get_file summary of this file.
  • source_files: the files that a merged or automerged file was built from. It’s empty for a source file.
  • merged_file and merged_scan: the automerged file built from a source file, and the search that found it, as for get_file with include: ["mergedFile"]. For a merged or automerged file, merged_file is the file itself.
  • operations: at most 10 operations built from the file, as list_operations results. operations_total is the total count.
  • fields: the fields those operations cover, with dashboardUrl and exploreUrl.
  • grower: the file’s grower, with dashboardUrl.

get_provider_connection

Reports which providers a grower is connected to and whether each connection works. Use it when data from a provider stops arriving, or to check whether an account is connected. The response contains only connection status fields, never tokens, keys, or secrets. The response is {leaf_user_id, shared, connections, not_connected, sync_summaries, sync_summaries_unavailable}. Each connection is {provider, status, created_time, client_environment, scopes, events, events_unavailable}. status is one of the following:
  • OK: the connection works.
  • UNAUTHENTICATED: Leaf has stopped pulling from this provider. The grower must reconnect the account.
  • MISSING_PERMISSION: the connection still syncs, but the provider refused some access.
  • TEMPORARILY_UNAVAILABLE: the provider is failing, and Leaf retries.
events holds the latest five calls that Leaf made with the credential, newest first, as {time, method, status_code, url}. Each url is reduced to its host and path. For a grower that another account shares with yours, shared is true and connections and not_connected are null.

get_user_units

Returns the unit system that Leaf uses to process a grower’s machine data. The response is {leaf_user_id, unitMeasurement, source}:
  • unitMeasurement is DEFAULT (mixed, for example mi/hr, ft, bu/ac, and lb), IMPERIAL, or METRIC.
  • source is leafUser when the grower has its own setting, or apiOwner when the project’s setting applies.
The units of one file or operation still come from get_file or get_operation with include: ["units"], because rate and product units vary within one setting.

get_effective_config

Returns the processing settings that Leaf applies to one grower’s machine data. Use it when data is missing or looks altered and a processing setting could explain it. The response is {leaf_user_id, shared, flags}. flags maps each setting to {value, source}, where source is leafUser (the grower’s own value), apiOwner (the project’s value), or unset. Settings include fieldOperationCreation, operationsProcessingRange, operationsAutoSync, fieldsAutoSync, splitOperationsByField, operationsMergeRange, operationsMergeRangeHarvested, fieldsAttachIntersection, operationsRemoveOutliers, operationsOutliersLimit, operationsFilteredGeojson, cleanupRules, and unitMeasurement. For a grower shared from another account, flags is null, because that account’s settings aren’t visible.

get_recent_failures

Checks whether many files are failing the same way across growers, which points to a platform issue that re-uploading doesn’t fix. Use it when a failure looks generic, such as an HTTP 5xx error or a step failure whose message names no cause in the file. The tool reads up to 100 failed files updated in the window, most recent first, and checks the pipeline steps of up to 20 of them. The response is {window_hours, failed_count, truncated, sampled, groups, widespread}. Each group is {step, message, files, growers, widespread, formats, providers, sample_file_ids}. A group is widespread when it has a step and at least five files from at least two growers.

draft_support_ticket

Drafts a Leaf support (Zendesk) ticket in the layout of the support form. The tool only drafts: it doesn’t submit anything, and no ticket exists afterward. You send the request yourself by pasting the draft into the form at submit_url, Leaf’s support request page. The response is {submitted, submit_url, fields, missing_required, invalid, unresolved, conflicts, text}. submitted is always false. fields lists {label, value} pairs in form order, and text is the paste-ready draft. The tool fills the API Owner, Operation Type, Data Provider, and Leaf User ID fields from your account and the records named by the IDs you pass.

Knowledge

The knowledge base holds Leaf’s support troubleshooting procedures and reference pages. Assistants search it before they troubleshoot missing, failed, stuck, or wrong data, and then follow the matching procedure.

search_knowledge

Searches published knowledge pages. Query words are matched against page titles, tags, and the full page text. The response is {results: [{slug, title, kind, summary, tags, sources}], count}. kind is reference (a fact or convention page) or procedure (a step-by-step troubleshooting procedure).

get_knowledge_page

Returns the full Markdown of one knowledge page as {slug, markdown}. If the page doesn’t exist or isn’t published, the response is {slug, error}. Links between knowledge pages resolve: slug also accepts the target of a link inside a page, such as a relative .md path.

Units

get_unit_conversion_factor

Returns the exact factor to convert values from source_unit to target_unit: value_in_target = value_in_source * factor. The response is {factor, sourceUnit, targetUnit, usage}, plus assumption when the conversion goes through water density, or {error, hint} for unknown, incompatible, or malformed units. Units use Pint syntax, such as kg/m^2, m/s, mph, lb/acre, L/ha, or m^2. The following rules apply:
  • Crop yields use crop-specific test-weight bushels: corn_bushel, soybean_bushel, wheat_bushel, barley_bushel, oats_bushel, sorghum_bushel, rye_bushel, rice_bushel, canola_bushel, and sunflower_bushel. For example, converting kg/m^2 to corn_bushel/acre returns a factor of about 159.32.
  • Volume and mass conversions, such as gallon/acre to lb/acre, use the density of water (1 kg/L). The response includes an assumption field that states this; the result is wrong for products denser or lighter than water.
  • Generic bushels (bu or bushel) have no density, so a conversion between them and mass returns an error. Use the crop’s unit instead, for example corn_bushel/acre for bu/ac.
  • Temperatures with an offset, such as degC to degF, return an error, because no single factor converts them. For temperature differences, use delta_degC and delta_degF. For absolute temperatures, use the formula degF = degC * 9/5 + 32.

Weather

Weather tools come in two forms: field-based (pass a Leaf user ID and field ID) and coordinate-based (pass latitude and longitude). Each form supports daily and hourly granularity for both forecasts and historical data, for eight tools in total. All weather tools share these optional parameters:

Field-based weather

These tools require leaf_user_id (string) and field_id (string), plus the shared optional parameters.

Coordinate-based weather

These tools require lat (number) and lon (number), plus the shared optional parameters.

Billing

Contract tools require billing.view, and consumption tools require usage.view.

list_billing_contracts

Returns all billing contracts for the active project. Each contract includes product type, start and end dates, and quota. Contract product types:
  • AUDIT_FIELDS_BOUNDARY: active field boundary area (not bounded by contract dates)
  • FIELDS_BOUNDARY: field boundary area consumption within the contract period
  • FIELDS_BOUNDARY_SENTERA: Sentera-exclusive field boundary area
  • OPERATIONS_FILE: machine file area consumption
  • OPERATIONS_OPERATION: field operation area consumption
  • SATELLITE_PROCESS_PLANET: Planet satellite imagery area
  • SATELLITE_PROCESS_SENTINEL: Sentinel satellite imagery area

get_billing_contract

Returns details for one billing contract, including product type, start and end dates, region, and quota.

get_contract_consumption

Returns consumption metrics for a contract. If you don’t specify timestamp, the tool returns the current day’s data.

get_contract_consumption_range_api_owner

Returns a daily consumption breakdown for the project over a time range.

get_contract_consumption_range_leaf_user

Returns a daily consumption breakdown for one Leaf user over a time range.

Errors and validation

Tools return structured errors instead of raw upstream responses. The error field holds one of these codes: An error can also include a key that names the specific problem (for example, ranked_search_first_page_only or no_boundary), a message, and the upstream http_status. get_unit_conversion_factor and get_knowledge_page put a readable message in error instead of a code. The grower, field, operation, file, and batch tools reject empty IDs, whitespace-only IDs, ., .., and IDs that contain path separators. They return not_found without sending the ID to the Leaf API. The region, field set, file tracker, resolve_id, and spatial tools require UUIDs and return invalid_request for an ID that isn’t one. If your project’s plan or your role doesn’t allow a tool or an include, the call is refused with a message that names the missing permission. For details, see Access and projects.
Last modified on November 23, 2026