Write a skill that uses tools

    A skill that uses tools is a normal skill: a SKILL.md with instructions, and any files it needs. The steps that make or look something up name an Agensi tool and say what to do with its result. The buyer's agent prices, runs and pays for each use.

    Write tool steps as instructions#

    Buyers' agents call tools through their Agensi connection. So a tool step is an instruction to the agent, not code: a bundled script can't call Agensi tools.

    Each tool step says:

    • Which tool, by its id, like agensi:google.serp.maps, or by its name. Ask your agent "Find the Agensi tool for Google Maps places" for the id, or see the tools on your skill's list.
    • What to send it, with the options that matter, like the search words, the number of results, or a video's length and resolution.
    • What to do with the result: which fields to use, what to show the buyer, or which step it feeds.

    Writing a tool's id or its own name also tells Agensi to add that tool to your skill's list when you upload. See Add tools to your skill.

    An example#

    A skill that finds local businesses and their owners' work emails, with three tools:

    markdown
    ---
    name: local-lead-finder
    description: Find local businesses in a city, with ratings, owners and work emails, ready for outreach.
    ---
    
    # Local lead finder
    
    ## Tools
    
    This skill uses three Agensi tools:
    
    - `agensi:google.serp.maps`: Google Maps places for a search
    - `agensi:google.serp.organic`: Google search results
    - `agensi:people.email.find`: a person's work email from their name and company domain
    
    ## Steps
    
    1. Ask for the kind of business and the city, for example "dentists in Austin, TX", and how many leads they want (at most 20).
    2. Search Google Maps with `agensi:google.serp.maps`, sending `q` as the kind of business and the city. From `places`, keep the ones with a website. List them with name, rating, number of reviews and website.
    3. Show the list and ask which businesses to keep.
    4. For each one kept, search Google with `agensi:google.serp.organic` for its name, city and "owner", with `limit` 5. Take the owner's full name from the results. If no name is clear, mark it "owner not found" and skip it in the next step. Run these searches as one batch.
    5. Look up each owner's work email with `agensi:people.email.find`, sending `full_name` and `domain` (the website's domain). Run these lookups as one batch. If no email is found, write "not found": failed lookups cost nothing.
    6. Give the result as a table: business, rating, reviews, owner, email, website. End with what the tool uses cost in total.
    

    A voice-over step in another skill could read:

    markdown
    5. Read the final script aloud with `elevenlabs:text-to-speech`, sending it as `text` (up to 5,000 characters per use; split a longer script at paragraph breaks). Give the buyer the audio link and say it works for 7 days.
    

    Keep costs clear#

    • Don't write prices. Prices can change. Your listing and the buyer's agent always show the current starting prices.
    • Say how many uses a run makes, for example "one search, then one lookup per business, at most 20". Buyers and their agents can then judge the cost.
    • Batch many uses of one tool. Up to 100 uses of one tool are priced together and approved once, if the buyer chose to be asked. Videos are priced one at a time.
    • Confirm before big steps. By default a buyer's agent runs uses without asking while their balance covers them. Before a step that can make many paid uses, have the agent show the plan, like the list of businesses, and ask which to go ahead with.
    • Set the options that change the price. Defaults differ between models, so say the length, resolution, number of results or quality your skill needs.

    Handle results well#

    • Data comes back as data. Name the fields your steps use: agensi:google.serp.maps returns places in places, and agensi:google.serp.organic returns results in results. Long answers can be read in parts: say what to filter or sort by, like "the 10 with the most reviews".
    • Files come back as links that work for 7 days, and stay in the buyer's Dashboard → Tools for 30 days. Say what to do with each one: give the buyer the link, or pass it to the next step, like an image to a video tool.
    • Slow jobs take minutes. A video can take a few minutes. The agent checks on it until it's ready, so say what it can do meanwhile, if anything.
    • Plan for misses. A search can come back empty and a lookup can fail. Say what to do: skip it, mark it, or try once with other words. Failed uses cost nothing.
    • Buyers' files. If a step works on the buyer's own image, recording or CSV, say so: their agent uploads it first so the tool can read it.

    Don't ask buyers for keys a tool covers#

    Remove steps that ask buyers for their own key or account for a service one of your tools covers, like a SerpAPI, Hunter, ElevenLabs or Kling key. Buyers' agents skip those steps anyway, but a skill without them is clearer. Leave those accounts out of your listing's Requires section too: buyers don't need them.

    Test it#

    • Before it's live: ask your agent to run each tool directly with what your steps would send, like "Use Agensi to find Google Maps places for dentists in Austin, TX", and check the results have the fields your steps use. Ask "Show the Agensi tools on my skill local-lead-finder" to check its list.
    • Once it's live: load your own skill in your agent and run it as a buyer would. Loading your own skill is free and doesn't count as a use.
    • Tool uses you make are paid from your own balance, like anyone's. New accounts' free credit works for tools too.

    Before you submit#

    • Every tool step names its tool and says what to send.
    • Every tool your steps use is on your skill's list, with no "mentioned, not added" warning.
    • No step asks buyers for a key that a tool covers.
    • No prices in your SKILL.md or listing text.
    • Many uses of one tool run as a batch, and big steps are confirmed first.
    • Each tool step says what to do with the result, and what to do when it fails.