#[Solved ✅] WEATHERMAP_WEATHER returns kelvins, trying to modify params

1 messages · Page 1 of 1 (latest)

tranquil meadow
#

I tried writing a pre-processor like this:

import { TPreProcessor } from "composio-core"

export const preProcessor: TPreProcessor = ({ actionName, params }) => {
  console.log(actionName, params)

  switch (actionName) {
    case "WEATHERMAP_WEATHER":
      // Follows OpenWeatherMap API
      return { ...params, units: "imperial" }
    default:
      return params
  }
}

However it still comes back in kelvins. Do I need to also modify the SchemaProcessor to allow for it?

timber cypressBOT
#

Hi, currently we don't support passing the units as an arg while making the tool call. Location is the only arg that can be passed. To see the accepted args please refer the schema from UI.

tranquil meadow
#

previously i was recommended to do that. Surely you don't intend everyone to see all weather in Kelvins

tranquil meadow
#

i'm surprised we're not able to pass extra params to the endpoint as passthrough - is there a security concern with that?

timber cypressBOT
#

Not a security concern - it's more about ensuring consistent behavior. We enforce constraints and only allow specific parameters (like location) because LLMs might make mistakes with additional fields or generate inconsistent values

We support building custom actions, you can you this to create a new action for the same endpoint but with additional fields that you want to pass: https://docs.composio.dev/concepts/tool-calling#using-custom-tools

tranquil meadow
#

i can build workarounds but this is part of the openweather api endpoint. makes me nervous to adopt more actions with unknown limitations