Skip to main content
You don’t need this page to use AnythingMD from an agent: the tool descriptions tell the agent what to do. It’s for people building agents, prompts or evaluations on top of the server. Each tool calls the same handler as the REST API, so scopes, credits, idempotency and error codes are identical. Never put file bytes or base64 in tool arguments; use create_upload.

convert_to_markdown

The server waits up to about 50 seconds in total, counted from the start of the call, then returns one of three things. Finished. The tool text is the first page of Markdown (up to about 20,000 tokens), then a footer:
structuredContent carries the same fields. nextCursor appears only when more Markdown remains. markdownDownloadUrl is the whole document; it’s signed and expires, so pass it on exactly as returned, including everything after ?. Report creditsCharged, not creditsReserved. Still running. The text says so and gives the jobId; call get_conversion with it. Starting a second conversion of the same file doesn’t help and can be charged twice. Refused or failed. isError is set and the text names the cause and whether a retry can help. Failed and canceled jobs are not charged. Codes are listed in Errors.

create_upload

Returns documentId, uploadUrl with the Content-Type to send, expiresAt, a ready curl -X PUT -T command for agents with a shell, and browserUploadUrl for agents without one (the user opens it and picks the file). After the upload finishes, call convert_to_markdown with the documentId. An expired slot can’t be reused; call create_upload again.

get_conversion

Each call advances the job once. Replies have the same shapes as convert_to_markdown.

When to stop paging

The page cap protects one reply, not the whole conversation. Do not walk every page into context: an agent that follows every nextCursor fills its own context window with a document it may not need. Stop after the first page unless there is a reason to continue: Treat nextCursor as an option to decline, not a queue to drain.

get_pricing

Returns estimatedCredits and maximumCredits (what the workspace must have available to start). A URL whose server doesn’t report a size can’t be quoted, but can still be converted. convert_to_markdown reports the credits it reserved, so this call is optional.

cancel_job

A queued job is canceled at once. A running job stops at its next step; get_conversion then reports it as canceled. Canceled jobs are not charged.