tray-api

tray-api is a cursor rule for Cursor from tray-tecnologia/tray-api-ai-plugin. It costs 70 tokens per session (1,641 once invoked), scanned A, original, MIT.

A set of rules and documentation for working with the Tray online-store API.

In plain words
What is it for?
Use it when building or reviewing Tray features such as products, orders, customers, webhooks, shipping, or payments.
Why use it?
It helps prevent common integration errors involving authentication, request formats, limits, pagination, and required project checks.

Cursor rule for Cursor

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/tray-tecnologia/tray-api-ai-plugin/tray-api
Clone the repo
git clone --depth 1 https://github.com/tray-tecnologia/tray-api-ai-plugin

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for tray-api

README.md
[![agentmods](https://agentmods.dev/badge/rules/tray-tecnologia/tray-api-ai-plugin/tray-api.svg)](https://agentmods.dev/rules/tray-tecnologia/tray-api-ai-plugin/tray-api)
Your own site
<a href="https://agentmods.dev/rules/tray-tecnologia/tray-api-ai-plugin/tray-api"><img src="https://agentmods.dev/badge/rules/tray-tecnologia/tray-api-ai-plugin/tray-api.svg" alt="Measured on agentmods" height="20"></a>
Per session 70 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,641 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00070 $0.01641
Opus 5 $0.00035 $0.00821
Sonnet 5 $0.00014 $0.00328
Haiku 4.5 $0.00007 $0.00164

Measured 5d ago against content hash e22c29d5b725, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

tray-api scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/tray-api.mdc · 118 lines

How it starts

The opening of the file, as written. The whole thing — 118 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Tray API — Regras do projeto

Convenções obrigatórias

  • access_token como query parameter em toda chamada: ?access_token={token}.
  • URL base: https://{api_address}/ (retornada no callback OAuth, varia por loja).
  • access_token expira em 3 h; refresh_token expira em 30 dias.
  • Payload JSON envolto na chave do recurso: {"Product": {...}}, {"Order": {...}}.
  • Rate limit: 180 req/min e 10.000 req/dia — tratar HTTP 429 com retry exponencial.
  • Paginação máxima: 50 itens por requisição.
  • Nunca escrever access_token, consumer_key ou consumer_secret como literais.

Bloco MANDATORY e lint de skills

  • Toda skill nova deve ter ## MANDATORY: Tool Call(s) Required Before Answering imediatamente após o frontmatter.
  • O bloco deve incluir chamada OBRIGATÓRIA(S) a node skills/tray-dev/scripts/search_docs.mjs (sempre).
  • Skills com schema local (categoria A: autorizacao, produtos, pedidos, clientes, webhooks, variacoes, categorias, marcas) devem incluir também chamada OBRIGATÓRIA(S) a node skills/<recurso>/scripts/validate.mjs.
  • Validar com npm run lint:skills. O CI roda npm run lint:skills antes do smoke.

Validação local

  • 8 skills têm scripts/validate.mjs: autorizacao, produtos, pedidos, clientes, webhooks, variacoes, categorias, marcas.
  • Skills com múltiplos schemas exigem --schema=<op>. Use --list-schemas para descobrir os disponíveis.
  • Output humano por default; --json para programático. Exit codes: 0 válido · 1 inválido · 2 erro de uso.
  • Formats BR custom: cpf, cnpj, cep, ean, ncm, date, datetime, email, uri. Detalhes em scripts/lib/SUBSET.md.

Busca em docs

Para confirmar comportamento da API antes de gerar código, use a skill tray-dev:

node skills/tray-dev/scripts/search_docs.mjs "<termo>"
node skills/tray-dev/scripts/search_docs.mjs --topic=<slug> "<termo>"
node skills/tray-dev/scripts/search_docs.mjs --json "<termo>"

Read the full file on GitHub · 118 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 118 lines · 70 tokens per session scan A e22c29d5b725

Subscribe to this mod's changes

tray-api is a cursor rule published in the GitHub repository tray-tecnologia/tray-api-ai-plugin (15 stars, last pushed 23d ago), licensed MIT. It adds 70 tokens to every session and 1,641 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.