/cookbook:retrieve-document-by-urlfrom cookbook
Retrieve one indexed document you can open in Glean by its URL, then retrieve that same document by the document ID printed in the first response.
Ships in cookbook. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Build "Retrieve a document by URL" following https://developers.glean.com/cookbook/retrieve-document-by-url
Use nonsecret inputs the user already supplied. Ask only for missing information needed by the selected recipe path, resolving dependent choices before continuing. Do not request credential values in conversation; use the recipe's documented secure sign-in or secret-entry path. Required questions for this recipe are:
Follow the selected authentication path. If OAuth is selected, run the recipe's shipped login command with its declared scopes. If the documented token path is selected, skip OAuth login and use that path's declared secure configuration. Keep sign-in and secret entry user-controlled. Do not implement or alter OAuth while setting up the recipe, and do not silently substitute a path when the documented one fails.
Run the step commands in one shell session, starting in the directory where the project should be
created. A cd in one step still applies to later steps, so do not repeat it. If your tool starts
each command in a fresh process, run each later command from the directory the earlier cd entered.
A step marked (new terminal) runs while an earlier step keeps running: start it in a new shell in
the starting directory, and run the steps after it in that shell.
Copy the project onto your machine
Copy the runnable TypeScript CLI and its offline tests into a new directory. Sign-in uses the official @gleanwork/auth package.
npx -y [email protected] gleanwork/glean-cookbook/recipes/retrieve-document-by-url retrieve-document-by-url
Install dependencies Enter the project directory and install its dependencies. Run the remaining commands from this directory.
cd retrieve-document-by-url && npm install
Run the offline tests Run the tests. They do not use your Glean login or the network. Passing tests does not prove you can reach your Glean instance.
npm test
Choose an authentication path
OAuth is the default. @gleanwork/auth discovers your instance, registers the OAuth client dynamically, and stores credentials outside the project. If OAuth is unavailable, copy .env.example to .env, set GLEAN_SERVER_URL to your backend origin, for example https://<instance>-be.glean.com, and create a user-scoped API token with Read documents (documents:read). On the legacy token screen, choose DOCUMENTS. Put that token in GLEAN_API_TOKEN and skip the next step. Omit --email from the remaining commands. If email discovery finds the wrong instance, replace --email with --server-url and that same backend origin.
Sign in with OAuth
Run the login command with the documents:read scope and finish authorization in your browser. Wait until the command reports success. Skip this step when you configured a token in .env.
npm run login -- --email "<work-email>"
Verify against your instance
Retrieve one document you can open, then retrieve it again by the returned document_id. The command prints the permalink, title, datasource, and both request IDs. With a token in .env, omit --email.
npm start -- --email "<work-email>" --url "<document-url>"
Request extracted text
Run the same retrieval with --content. The command prints content_segments: and a short content_preview: of the first non-empty segment, or the line content: no extracted text. You still see the document when there is no extracted text. If Glean cannot read the text you asked for, the command fails. With a token, omit --email.
npm start -- --email "<work-email>" --url "<document-url>" --content
Run the command in this chat and report its concise result rather than reproducing routine install or debug output. Do not invent a browser URL. Then give the first verification action.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub gleanwork/glean-cookbook --plugin cookbook19 skills in this plugin
/batch-retrieve-documentsRetrieve up to 100 indexed documents you can open in Glean, mixing document IDs and URLs. Documents Glean does not return are listed under warnings./browse-cookbookUse when the user asks what Glean cookbook recipes exist, wants to browse or pick a recipe to build, or asks "what can I build with Glean" — lists the available recipes and points to the matching /cookbook:{recipe-id} command./cookbook-conventionsShared setup, authentication, browser handoff, documentation lookup, Web SDK sizing, and visual conventions for Glean cookbook recipes./customer-360One page per account — status, risks, and a drill-in chat — assembled from whatever your instance already knows about that customer. No CRM export, no separate index./customer-meeting-prep-triggerRegister a calendar Trigger through the Platform Triggers API and deliver one signed event to a small receiver that prints a customer-meeting prep request./embed-search-chatPut permission-aware Glean search and chat directly inside an internal app with the Web SDK, so your team gets answers where they already work.