Automate Actions with Zapier
LlamaIndex tool letting an agent trigger Zapier actions via natural language queries.
Why it matters
Leverage the Zapier Natural Language Actions API to automate tasks and access information across your connected applications through natural language commands.
Outcomes
What it gets done
List available Zapier actions.
Execute Zapier actions using natural language queries.
Integrate with Google Drive to find files.
Connect to your Zapier account via API key or OAuth token.
Install
Add it to your toolbox
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/li-tool-tools-zapier | bash Overview
Zapier Tool
The Zapier Tool wires Zapier's natural language actions API into a LlamaIndex agent as two functions: listing enabled actions and running natural-language queries against them. Use it when an agent needs to trigger or query actions already enabled in your Zapier account. It requires a Zapier API key or OAuth token, plus the NLA API enabled on your account.
What it does
The Zapier Tool connects to a Zapier account and gives an agent access to Zapier's natural language actions (NLA) API. It exposes two functions: list_actions (returns the actions you have enabled through Zapier) and natural_language_query (makes a natural-language query to Zapier).
When to use - and when NOT to
Use it when an agent needs to trigger or query the actions you have already enabled in your Zapier account -- for example asking "what actions are available" or "Can you find the taco night file in google drive." It requires a Zapier API key or OAuth token, and the underlying NLA API must be enabled on your Zapier account first, so it is not usable out of the box.
Inputs and outputs
Initialize with your Zapier API key or OAuth token, then attach to an agent:
from llama_index.tools.zapier import ZapierToolSpec
from llama_index.core.agent.workflow import FunctionAgent
from llama_index.llms.openai import OpenAI
zapier_spec = ZapierToolSpec(api_key="sk-ak-your-key")
### Or
zapier_spec = ZapierToolSpec(api_key="oauth-token")
agent = FunctionAgent(
tools=zapier_spec.to_tool_list(),
llm=OpenAI(model="gpt-4.1"),
)
print(await agent.run("what actions are available"))
print(await agent.run("Can you find the taco night file in google drive"))
Who it's for
Developers building agents that need to trigger or query Zapier's connected apps and workflows through natural language, without hand-coding each action's API call.
Source README
Zapier Tool
This tool connects to a Zapier account and allows access to the natural language actions API. You can learn more about and enable the NLA API here: https://nla.zapier.com/start/
Usage
This tool has more extensive example usage documented in a Jupyter notebook here
Here's an example usage of the ZapierToolSpec.
from llama_index.tools.zapier import ZapierToolSpec
from llama_index.core.agent.workflow import FunctionAgent
from llama_index.llms.openai import OpenAI
zapier_spec = ZapierToolSpec(api_key="sk-ak-your-key")
### Or
zapier_spec = ZapierToolSpec(api_key="oauth-token")
agent = FunctionAgent(
tools=zapier_spec.to_tool_list(),
llm=OpenAI(model="gpt-4.1"),
)
print(await agent.run("what actions are available"))
print(await agent.run("Can you find the taco night file in google drive"))
list_actions: Get the actions that you have enabled through zapiernatural_language_query: Make a natural language query to zapier
This loader is designed to be used as a way to load data as a Tool in a Agent.
FAQ
Common questions
Discussion
Questions & comments · 0
Sign In Sign in to leave a comment.