arcade-mcp/arcade
Nate Barbettini 56fc83bf3e
Fix Github.CountStargazers and add tests (#92)
## Problem
I found a bug with `Github.CountStargazers` where a stargazer count of
`0` was interpreted as a null result. In other words, 0 wasn't passed
back to the Engine correctly.
Separately, the tool function was also not authorized correctly.

## Fix
- Don't use a falsy comparison when evaluating `result` inside the
`ToolOutputFactory`
- Add unit tests for `ToolOutputFactory` to give us confidence in the
business logic
- Added `ToolContext` to pass in the authorization token correctly.

Before
```
User (nate@arcade-ai.com): 
how many stars does the ArcadeAI/Docs repo have on github?

Assistant (gpt-4o): 
I successfully checked the repository, but unfortunately, I cannot provide the number of stars for the ArcadeAI/Docs repository. Please try checking directly on GitHub for the most accurate information.                                                                                        
Called tool 'Github_CountStargazers'
Parameters:{"owner":"ArcadeAI","name":"Docs"}
'Github_CountStargazers' tool returned:Github.CountStargazers called successfully
```

After
```
User (nate@arcade-ai.com): 
how many stars does the ArcadeAI/Docs repo have on github?

Assistant (gpt-4o): 
The ArcadeAI/Docs repository on GitHub has 0 stars.                                                                                                                                                                 
Called tool 'Github_CountStargazers'
Parameters:{"owner":"ArcadeAI","name":"Docs"}
'Github_CountStargazers' tool returned:0
2024-10-04 16:09:08 -07:00
..
arcade Fix Github.CountStargazers and add tests (#92) 2024-10-04 16:09:08 -07:00
tests Fix Github.CountStargazers and add tests (#92) 2024-10-04 16:09:08 -07:00
codecov.yaml Tool SDK, Schemas (#2) 2024-07-14 23:37:46 -07:00
poetry.toml Dockerfiles for Actor container (#18) 2024-08-22 16:28:42 -07:00
pyproject.toml SDK: Generic OAuth 2.0 connector (#81) 2024-10-03 16:40:02 -07:00
run_cli.py Add New Gmail Tools To The Google Toolkit (#41) 2024-09-19 10:18:49 -07:00
tox.ini Fix extras in pyproject.toml (#58) 2024-09-24 18:02:56 -07:00