/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { featuresGetHistoricalValues } from "../../funcs/featuresGetHistoricalValues.js"; import * as operations from "../../models/operations/index.js"; import { formatResult, ToolDefinition } from "../tools.js"; const args = { request: operations.GetFeaturesHistoricalValuesRequest$inboundSchema, }; export const tool$featuresGetHistoricalValues: ToolDefinition = { name: "features-get-historical-values", description: `Get historical values for a feature Returns historical values for a given feature code. The feature code is a unique identifier for a specific feature, such as weather or crop health data. Feature codes can be obtained with the \`/v1/features\` endpoint.`, args, tool: async (client, args, ctx) => { const [result, apiCall] = await featuresGetHistoricalValues( client, args.request, { fetchOptions: { signal: ctx.signal } }, ).$inspect(); if (!result.ok) { return { content: [{ type: "text", text: result.error.message }], isError: true, }; } const value = result.value; return formatResult(value, apiCall); }, };