npx skills add ...
npx skills add run-llama/llamaparse-agent-skills --skill llamaparse
Use this skill when the user asks to parse the content of an unstructured file (PDF, PPTX, DOCX...)
npx skills add run-llama/llamaparse-agent-skills --skill llamaparse
Parse unstructured documents (such as PDF, DOCX, PPTX, XLSX) with LlamaParse and extract their contents (text, markdown, images...).
When this skill is invoked, respond with:
Then wait for the user's input.
llama-cloud (optional)If the user does not have the @llamaindex/llama-cloud package installed, add it to the current environment by running:
Once the user confirms the environment variables are set and provides the necessary details for the parsing job, produce a typescript script.
As a source of truth for the TS script, you can:
https://developers.llamaindex.ai/python/cloud/llamaparse/api-v2-guide/ page.Follow these guidelines when generating scripts:
LlamaCloud ClientUse LlamaCloud (the API client) for all parsing operations:
Always upload first to get a file ID, then parse using the file ID. Never pass raw file bytes directly to parse().
If the user already has a file ID (e.g. from a prior upload), skip the upload step and use it directly.
| Tier | When to Use |
|---|---|
fast | Speed is the priority; simple documents |
cost_effective | Budget-conscious; straightforward text extraction |
agentic | Complex layouts, tables, mixed content (default recommendation) |
agentic_plus | Advanced analysis, highest accuracy |
Default to agentic unless the user specifies otherwise or the document is simple.
expand ParameterThe expand parameter controls what content is returned. Omitting it returns minimal data. Always specify exactly what you need:
| Value | Returns |
|---|---|
text_full | Plain text via result.text_full |
markdown_full | Markdown via result.markdown_full |
items | Page-level JSON via result.items.pages |
text_content_metadata | Per-page text metadata |
markdown_content_metadata | Per-page markdown metadata |
items_content_metadata | Per-page items metadata |
images_content_metadata | Image list with presigned URLs |
output_pdf_content_metadata | Output PDF metadata |
xlsx_content_metadata | Excel-specific metadata |
Only request metadata *_content_metadata variants when you need presigned URLs or per-page detail — they increase payload size.
result.text_full, result.markdown_full, and result.items may be undefined on failure. Always guard against this:
Group options using the correct nested keys:
Use agentic_options.custom_prompt whenever the user wants to guide extraction (translation, summarization, structured extraction, etc.).
httpx and AuthWhen images_content_metadata is in expand, download images via presigned URLs with Bearer auth:
Every generated script should include the node shebang:
Once the typescript script has been produced, you should:
In order to run typescript scripts, it is highly recommended to use:
npx tsx script.ts.