Skip to content

Asana Toolkit #381

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 28 commits into
base: main
Choose a base branch
from
Open

Asana Toolkit #381

wants to merge 28 commits into from

Conversation

byrro
Copy link
Member

@byrro byrro commented Apr 25, 2025

Sorry this first version of the toolkit ended up getting too big. Task is the most relevant object, but it's 'entangled' with everything else in Asana. I realized the toolkit wouldn't be of much value if we didn't have some basic tools related to projects, workspaces, teams, users, and tags as well.

@byrro byrro added the toolkit: new For new toolkits label Apr 25, 2025
@byrro byrro self-assigned this Apr 25, 2025
Copy link

codecov bot commented Apr 25, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

📢 Thoughts on this report? Let us know!

@byrro byrro marked this pull request as ready for review May 5, 2025 17:29
@byrro byrro requested a review from a team May 5, 2025 17:29
Copy link
Member

@EricGustin EricGustin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is awesome & great coverage of the API.

One thing to think about: From what the evals are telling me, language models don't seem to fully grasp that they can provide multiple workspace_ids, or multiple tags in a single request. How can the annotations be improved to clear up this confusion?

break
if project_name_lower in names_lower:
matches.append(project)
names_lower.remove(project_name_lower)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

asana lets you create more than one project with the same name. This line is telling me that in the case of two projects named the same, only one of them would be returned by the tool.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is correct. I thought about that scenario. If the user does have 2+ projects with the same name, that's going to be an issue even in the GUI. Do you think we should raise an error saying it's not possible to resolve which project it is referring to?

) -> Annotated[dict[str, Any], "The created tag."]:
"""Create a tag in Asana"""
if not 1 <= len(name) <= 100:
raise ToolExecutionError("Tag name must be between 1 and 100 characters long.")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this feels like a preventable error for > 100 chars case. just use the first 100 chars?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general, I think raising an error is better than truncating when the user is creating a data point to avoid issues with silently unfulfilled expectations.

Asana docs says:

Name of the tag. This is generally a short sentence fragment that fits on a line in the UI for maximum readability. However, it can be longer.

My limit to 100 chars was arbitrary. I tried creating a tag with 5,000 chars and they still allow. I don't know if there's a hard limit, but it's ridiculous to allow a large tag name like this...

"Match tasks that started on OR BEFORE this date. Format: YYYY-MM-DD. Ex: '2025-01-01' "
"Defaults to None (searches tasks started on any date or without a start date).",
] = None,
completed: Annotated[
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there's no way to get intermediate status like 'in progress', 'in review', etc?

@byrro
Copy link
Member Author

byrro commented May 6, 2025

This is an area for improvement. I tried to make some tools more ergonomic. Like the tags arg in create_task or search_tasks. Instead of having to look for tag IDs, the tool takes a tag name and does the job of finding the IDs.

Even 4o is a bit flaky when taking advantage of this ergonomy. Sometimes, it'll invoke search_tags_by_name before creating a task instead of passing the tag names directly to create_task.

So far, I haven't found a way to make them consistent through the argument annotation or the function docstring.

Did any ideas pop to your mind that we could try?

byrro added 6 commits May 6, 2025 21:34
Having them as tools was confusign the LLMs when calling create_task,
update_task, or search_tasks. Instead of passing a tag name as arg to
create_task, for instance, the LLM was thinking it was supposed to call
search_tags_by_name first, which is unnecessary.
@byrro
Copy link
Member Author

byrro commented May 7, 2025

The search_tags_by_name and search_projects_by_name were confusing the LLMs. I moved them to simple utility functions. The toolkit already has list_projects and list_tags.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
toolkit: new For new toolkits
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants