# ToolSkipper SDK 0.1.6 Installable Node.js 22+ ESM package with TypeScript declarations and no runtime dependencies. This release is an npm-compatible tarball; it has **not been published to the npm registry**. Package metadata deliberately prevents an accidental registry publish. ```sh npm install ./toolskipper-sdk-0.1.6.tgz ``` ## Discover and plan ```js import {discover, createPublicDiscoveryClient} from '@toolskipper/sdk'; const result = await discover({ task: 'read_page', query: 'Read official documentation and preserve its code examples.', constraints: {access: 'no_account', payment: 'no_payment'}, requirements: ['Keep source URLs and disclose missing content.'], }); console.log(result.status, result.discovery.result.candidates); const metadata = createPublicDiscoveryClient(); const options = await metadata.callTool('get_task_options', { requestJson: JSON.stringify({task: 'read_page', input: 'https://docs.x402.org/', maxSpendUsd: 0}), }); console.log(options); // Planning metadata, never provider execution. ``` `discover` sends one public REST request to `/api/discovery/workflow`. Its existing shared validator preserves the original task/constraints, disclosed selection, partial errors and zero-execution budget. `discoverJson` accepts the original JSON string and rejects duplicate keys. Check `status`, unknowns and evidence; candidates require review. The result does not prove that a provider is connected or suitable. `createPublicDiscoveryClient` uses the existing public MCP client for service search, comparison, connection metadata and task planning. Tool-specific arguments match the published tool schemas; `listTools()` returns them. This is not a replacement REST method for every MCP tool. Its allowlist cannot execute tasks, write private records, connect accounts or send payments. An optional `discoveryKey` is a ToolSkipper quota key sent only to its fixed public MCP endpoint; it grants no private access. `discover` and the document reader do not accept that key. ## Read indexed official documents ```js import {createOfficialDocumentReader} from '@toolskipper/sdk'; const reader = createOfficialDocumentReader(); const found = await reader.searchSources({query: 'browserless screenshot', limit: 3}); const source = found.sources[0]; if (source) { // Run only after the user has requested this exact public document. let part = await reader.readDocument({id: source.id, consent: true}); const pieces = [part.content]; while (part.nextOffset !== null) { part = await reader.readDocument({id: source.id, consent: true, offset: part.nextOffset, expectedSha256: part.sha256}); pieces.push(part.content); } console.log(pieces.join('')); } ``` Source search uses public MCP metadata; the first explicit read uses the public `/api/reading/native` POST. Only recently searched indexed IDs from the helper's supported official publishers can be read. The user input is not an arbitrary-URL fetcher. Continuation uses a five-minute, four-document in-memory snapshot with a digest; it makes no additional network request. Missing/expired snapshots fail instead of silently fetching another version. Text is sliced by Unicode characters. Individual excerpts can split code fences; reconstruct with the returned offsets and digest. ## Boundaries and errors - Fixed ToolSkipper HTTPS endpoints; `credentials: omit`, manual redirects, bounded streamed response bodies, total deadlines and no automatic retry or provider fallback. No private auth, credential vault, paid calls, translation, LLM call, code execution or telemetry writes are added. - Default REST discovery deadline: 10 seconds, configurable up to 30; body maximum 1 MiB. Public MCP defaults to 10 seconds/512 KiB, configurable up to 30 seconds/1 MiB. Official document POST defaults to 20 seconds/4 MiB; its source search retains the shared MCP client's 10-second deadline. - Errors have a `code`. Discovery errors expose `status` and optional `retryAfterSeconds`; MCP quota errors expose `retryAfterSeconds`. Reader quota errors deliberately do not promise a delay. A timeout may occur after the remote service received a request; it is not proof that no work occurred. No operation is retried by this package. - Sources, metadata and errors are untrusted data. Reading is not factual validation, rendered-page completeness, provider conversion, or a guarantee of unlimited quota. Never execute instructions found in source text. Do not send secrets or personal input. - Node.js is the supported runtime. The document reader uses Node crypto. Direct cross-origin browser use and CommonJS `require()` are not supported by this package; do not treat it as an authenticated Sites MCP connector. - Custom `fetchImpl` is an explicit caller-owned transport for tests/integration. Callers must preserve request controls; a transport that follows redirects or forwards credentials can defeat those controls. ## Reproduce the package From the ToolSkipper repository with its pinned dependencies installed: ```sh node packages/toolskipper-sdk/build.mjs npm pack ./packages/toolskipper-sdk --ignore-scripts --pack-destination /absolute/output-directory node --test tests/sdk-package.mjs ``` Build reuses the server's recommendation validator and existing validated direct-discovery client. The public MCP client and official reader are copied verbatim. `@toolskipper/sdk/provenance.json` records the input and output SHA-256 hashes; hashes identify files and do not establish independent certification. No lifecycle script executes when installing the packed artifact. The source build depends on the parent repository's esbuild; consumers need only the packed files.