AI & Agents

Prompts for your agent

Copy a prompt into Codex or Claude Code to build a client, a page or a sync job on your Kanesh API.

Your agent can write the API code for you. These prompts work in Codex or Claude Code with the subscription you already have. Replace the parts in capitals, then paste.

Before you paste

  • Give the agent a personal API token in an environment variable, such as KANESH_ACCESS_TOKEN, never in the prompt.
  • Point it at your server with KANESH_URL, such as http://127.0.0.1:8080.
  • Turn on MCP so the agent can read your collections and fields itself.

Build a typed client

Write a small TypeScript client for my Kanesh API.
Server: KANESH_URL. Token: KANESH_ACCESS_TOKEN, sent as Authorization: Bearer.
Workspace ID: YOUR_WORKSPACE_ID.
Read the collections from GET /api/v1/workspaces/:workspace/collections and generate one type per collection.
Add list (limit, offset, query), get, create, update with If-Match, and delete for records.
Responses wrap results in data; errors have error.code and error.message. Throw a typed error for each.

Show records on a page

Add a page to my app that lists records from the Kanesh collection YOUR_COLLECTION.
Fetch on the server with the token in KANESH_ACCESS_TOKEN, never in the browser.
Use GET /api/v1/workspaces/:workspace/collections/:collection/records with limit=20 and offset for paging,
and meta.pagination.has_more to show a "Load more" button.
Add a search box that sends query={"search":"..."}.

Sync from another system

Write a Go job that copies rows from my CSV file into the Kanesh collection YOUR_COLLECTION.
Match existing records by the field YOUR_KEY_FIELD: query with filters [{"field":"YOUR_KEY_FIELD","operator":"eq","value":...}].
Update matches with PATCH and create the rest with POST.
Respect 429 rate_limited by waiting for Retry-After. Log the request_id of every failed call.

Write a report query

Using my Kanesh MCP connection, look at the collection YOUR_COLLECTION and write a GraphQL query
for POST /api/v1/workspaces/:workspace/graphql that returns the top 10 records by YOUR_NUMBER_FIELD,
filtered to YOUR_CONDITION. Use the query variable with filters and sort, and explain each part.

Tips

  • Ask the agent to read API overview first; the response format and error codes there stop most guessing.
  • Start with read-only calls. Let it write only after you have checked the reads.
  • Use a token with the least access the job needs, and revoke it when the job ends.
Buy me a coffee