Skip to content
Taku Docs

Version 1.4.0 (current)

Requests, responses, and call lifecycle

Read the request, result, and error from a taku/0.1 call.

The SDK and CLI use taku/0.1 to describe a call. It defines the data format; the transport separately selects how to reach a device. The existing SDK constructs requests for you, so you do not need to send the JSON below yourself.

Request fields

FieldType / requirementCurrent limit
protocolstring, requiredtaku/0.1
typestring, requiredrequest
idstring, required, 1–128 charactersCorrelates the response
methodstring, requiredImplemented dot-separated name, such as system.info
paramsobject, requiredMust be an empty object for current methods

This is an example request structure for reading system information:

{
  "protocol": "taku/0.1",
  "type": "request",
  "id": "req-1",
  "method": "system.info",
  "params": {}
}

One call

  1. The SDK or CLI constructs a request.
  2. The call entry point, called the facade in source, checks the protocol, method, and parameters.
  3. Metadata methods read local specifications; device-data methods run an Android probe through the selected transport.
  4. The call returns a result or an explicit error.

For example, a device-data call without a device connection is rejected:

{
  "protocol": "taku/0.1",
  "type": "response",
  "id": "req-1",
  "ok": false,
  "error": {
    "code": "DEVICE_REQUIRED",
    "message": "Provide Android transport",
    "retryable": false
  }
}

This illustrates the protocol structure. id matches the request. Read error when ok is false and result on success. retryable: false means repeating the same request is insufficient: first fix conditions such as the missing connection. The protocol does not elevate identity or turn unknown methods into arbitrary root commands.

Three different entry points

Entry pointWhat you receive
Host CLIComplete response JSON; also check the process exit code
JavaScript SDKDirectly returns result on success; throws TakuError on failure
Device shell entry pointComplete response JSON; accepts only system.info, displays.status and tasks.status, without phone-side Node.js. Call other device methods through the host CLI over adb

See CLI and SDK reference for usage and partial failures in aggregated extension results.

Outputs and events

See generated protocol and methods for each method’s parameters and result fields. Each query reflects the state at that moment. Different results on consecutive calls do not by themselves indicate a protocol error.

JSON Schema defines format validation; it does not establish an HTTP service for the whole system. Event formats are reserved, but general subscription, ordering, cursors, and deduplication remain unimplemented. See snapshots and events.

Next: Look up an error in the error index, or write a caller with your first development example.

Research preview · Current availability

Documentation retrieval

Search the published documentation for excerpts and citations. This uses full-text retrieval, not LLM-generated answers.

Every result links to the original article. Read research ideas separately from verified capabilities.

Help and troubleshooting →
Was this article helpful?
Report an issue or give feedback

Delivery to the maintenance queue does not mean it has been handled. Feedback is retained for 90 days.

Built with Fumadocs

On this page