Skip to content

fix: correct typos and GetWeather unit handling in tool examples#298

Closed
frankgoldfish wants to merge 1 commit intoanthropics:mainfrom
frankgoldfish:fix/typos-and-unit-in-tool-examples
Closed

fix: correct typos and GetWeather unit handling in tool examples#298
frankgoldfish wants to merge 1 commit intoanthropics:mainfrom
frankgoldfish:fix/typos-and-unit-in-tool-examples

Conversation

@frankgoldfish
Copy link
Copy Markdown

Summary

Fixes three related issues in the weather tool mock implementations across examples/tools/, examples/tools-streaming/, and examples/tools-streaming-jsonschema/:

  1. farenheitfahrenheit — The return value of GetTemperatureUnit and the Unit field in GetWeather were misspelled. The tool schema enum correctly uses "fahrenheit", so the mock was returning a value that doesn't match the declared enum.

  2. lattitudelatitude — Double-t typo in the tool input description for the lat field in tools/ and tools-streaming/ examples.

  3. GetWeather now returns the unit parameter — The function accepted a unit string argument but ignored it, always returning the hardcoded (misspelled) string. It now echoes back the requested unit.

Test plan

  • GetTemperatureUnit returns "fahrenheit" (matches the schema enum)
  • GetWeather returns the unit parameter value (consistent with what the model requested)
  • Latitude description is spelled correctly

🤖 Generated with Claude Code

Three issues fixed across the tools example files:
1. 'farenheit' -> 'fahrenheit' (misspelled in GetTemperatureUnit return value
   and GetWeather response, but the tool schema enum used the correct spelling,
   causing a mismatch between the schema and the mock implementation)
2. 'lattitude' -> 'latitude' (double-t typo in tool input description)
3. GetWeather now returns the unit parameter instead of a hardcoded string,
   so the response is consistent with whatever unit the model requested
@frankgoldfish frankgoldfish requested a review from a team as a code owner March 18, 2026 02:27
@frankgoldfish
Copy link
Copy Markdown
Author

Closing this PR — found that PR #260 already addresses this issue. Apologies for the duplicate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant