Skip to main content
Glama

Run code against apinoa

execute
Read-only

Run TypeScript against the apinoa API to filter, aggregate, and rank results in code, returning only concise data instead of raw API responses.

Instructions

Run TypeScript that calls the apinoa API, and get back only what it prints or returns. Use it for every data task, from one call to thousands: fan out over accounts or posts, follow pages, then filter, count, rank and average in the code, so raw API answers never fill the conversation.

The code is the body of an async function: use await, and return a small result (aggregate, slice, pick the fields you need). In scope:

  • apinoa..(params): one API call, returns the answer's data; throws ApinoaError (code, status) on a refusal. search_docs lists the parameters and the fields returned.

  • pages(op, params, { maxPages }): every item of a paged operation, following cursors (default 5 pages).

  • many(items, fn, { concurrency }): fn over every item, 8 at a time by default; a failed item comes back undefined.

  • store.save(name, value) / store.load(name) / store.list() / store.saveFile(name, base64): data kept on this machine between runs.

  • usage: { calls, units, budget } of this run. The code is type-checked before it runs: an operation, parameter or field that does not exist fails there, before anything is billed. Each call costs units (1 unit = $0.001, per search_docs); the run stops once budget_units are spent. Answers are cached for 10 minutes, so re-running after a fix costs nothing for calls already made. Only the API is reachable from the code.

Example: const page = await apinoa.tiktok.posts({ hashtag: "glassskin", limit: 50 }); const authors = [...new Set(page.items.map((p) => p.author.handle))].slice(0, 10); const recent = await many(authors, (u) => apinoa.tiktok.posts({ username: u, limit: 30 })); return authors.map((u, i) => { const views = (recent[i]?.items ?? []).map((p) => p.metrics?.views ?? 0).sort((a, b) => a - b); return { author: u, median: views[Math.floor(views.length / 2)] ?? null }; });

Operations (call search_docs with words or a platform for parameters, costs and the fields returned):

  • apinoa.aliexpress: search, browse, categories, imageSearch, product, shipping

  • apinoa.amazon: search, imageSearch, browse, categories, product

  • apinoa.app-store: search, app, reviews

  • apinoa.baidu: search, suggestions

  • apinoa.baidu-wenxin: answer

  • apinoa.bing: search, suggestions

  • apinoa.chatgpt: answer

  • apinoa.company: technologies

  • apinoa.copilot: answer

  • apinoa.daum: search, suggestions

  • apinoa.doubao: answer

  • apinoa.duckduckgo: search, suggestions

  • apinoa.facebook: profile, profiles, ads

  • apinoa.gemini: answer

  • apinoa.google: search, suggestions, places, place

  • apinoa.google-ai-mode: answer

  • apinoa.google-aio: answer

  • apinoa.google-play: search, app, reviews

  • apinoa.google-shopping: search, product, reviews

  • apinoa.google-trends: explore, trending

  • apinoa.instagram: profile, post, posts, comments, group, groups

  • apinoa.linkedin: profile, post, posts, comments, group, job, jobs

  • apinoa.meta-ai: answer

  • apinoa.naver: search, suggestions, places, place, reviews

  • apinoa.naver-ai-brief: answer

  • apinoa.naver-ai-tab: answer

  • apinoa.qwen: answer

  • apinoa.reader: page

  • apinoa.reddit: profile, profiles, post, posts, comments, group, groups

  • apinoa.seznam: search, suggestions

  • apinoa.shopify: search, imageSearch, catalog, product, reviews

  • apinoa.sogou: search, suggestions

  • apinoa.threads: profile, post, posts, comments

  • apinoa.tiktok: profile, profiles, post, posts, comments, group, groups, media

  • apinoa.tiktokshop: search, browse, categories, catalog, product, reviews

  • apinoa.tripadvisor: places, place, reviews

  • apinoa.unlocker: request

  • apinoa.walmart: search, browse, categories, product, reviews

  • apinoa.x: profile, post, posts, group

  • apinoa.yahoo: search, suggestions

  • apinoa.yahoo-japan: search, suggestions

  • apinoa.yandex: search, suggestions, places, place, reviews

  • apinoa.youtube: profile, profiles, post, posts, comments, groups

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "code": "<code>"
    },
    "name": "execute"
  }
}

Input Schema

NameRequiredDescriptionDefault
codeYesTypeScript: the body of an async function. Return the result.
budget_unitsNoMost units this run may spend (default 500, at most 20000).
timeout_secondsNoStop the run after this long (default 300).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.2.1

TDQS

A4.7/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations only supply readOnlyHint and openWorldHint; the description adds the full behavioral picture: per-call unit costs (1 unit = $0.001), the run halting at budget, type-checking that fails before billing, 10-minute answer caching so re-runs after a fix are free, sandboxing ('only the API is reachable'), and store persistence across runs. It also documents failure semantics (ApinoaError with code/status) and partial-failure behavior in many() (undefined for a failed item). Minor tension worth noting: store.save/saveFile write persistent local state despite readOnlyHint=true, though the external API calls are read operations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loading is strong — purpose, then scope/helpers, then a worked example, then operations. But the roughly 50-line operation catalog is long, and the description itself says search_docs returns parameters, costs, and fields, making the catalog partially duplicative; the in-scope helper list and example carry most of the unique value.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a high-complexity code-execution tool with no output schema, the definition covers everything an agent needs to invoke it safely: return contract, error type, scoping helpers with defaults, cost/budget mechanics, caching, timeout, persistence, and a non-trivial worked example. Nothing material is left to inference.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the three parameters are already documented; the description adds meaning the schema lacks, notably the unit-cost model behind budget_units, caching behavior that makes reruns free, and the exact shape the code parameter must take (async function body, await, small returned result). It does not restate the numeric defaults or maximums, correctly leaving those to the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The first sentence gives a precise verb+resource ('Run TypeScript that calls the apinoa API') plus the distinctive output contract ('get back only what it prints or returns'). It explicitly separates this tool from the sibling it depends on by directing the agent to search_docs for parameters, costs, and returned fields.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

States the usage condition directly ('Use it for every data task, from one call to thousands') and explains why — filter, count, rank in code so raw API answers never fill the conversation. It also names the complementary tool (search_docs) for the doc lookups this tool does not answer, and specifies the fallback pattern for iterative work.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.