From glean-pack
Indexes documents into Glean custom datasources via Indexing API and searches using Client API. For building connectors, testing search quality, or learning patterns.
npx claudepluginhub jeremylongshore/claude-code-plugins-plus-skills --plugin glean-packThis skill is limited to using the following tools:
Index documents into Glean and search them. Two steps: set up a custom datasource with the Indexing API, then query with the Client API.
Provides typed TypeScript client for Glean API with batch indexing, pagination, search, and error handling. Useful for production Glean integrations.
Searches and fetches Glean developer docs via MCP tools for APIs, SDKs (Python/JS), MCP config, authentication, indexing, and integrations.
Manages Gemini CLI documentation lifecycle: scrape from geminicli.com, validate index integrity, refresh/rebuild from filesystem, clear cache. Run via /docs-ops.
Share bugs, ideas, or general feedback.
Index documents into Glean and search them. Two steps: set up a custom datasource with the Indexing API, then query with the Client API.
const GLEAN = `https://${process.env.GLEAN_DOMAIN}/api`;
const idxHeaders = {
'Authorization': `Bearer ${process.env.GLEAN_INDEXING_TOKEN}`,
'Content-Type': 'application/json',
};
// Create or configure a custom datasource
await fetch(`${GLEAN}/index/v1/adddatasource`, {
method: 'POST', headers: idxHeaders,
body: JSON.stringify({
name: 'my_wiki',
displayName: 'Internal Wiki',
datasourceCategory: 'PUBLISHED_CONTENT',
urlRegex: 'https://wiki.company.com/.*',
iconUrl: 'https://wiki.company.com/favicon.ico',
}),
});
// Index individual documents
await fetch(`${GLEAN}/index/v1/indexdocuments`, {
method: 'POST', headers: idxHeaders,
body: JSON.stringify({
datasource: 'my_wiki',
documents: [{
id: 'doc-001',
title: 'Getting Started Guide',
url: 'https://wiki.company.com/getting-started',
body: { mimeType: 'text/plain', textContent: 'This guide covers onboarding steps...' },
author: { email: 'jane@company.com' },
updatedAt: new Date().toISOString(),
permissions: { allowAnonymousAccess: true },
}],
}),
});
console.log('Document indexed.');
const searchHeaders = {
'Authorization': `Bearer ${process.env.GLEAN_CLIENT_TOKEN}`,
'X-Glean-Auth-Type': 'BEARER',
'Content-Type': 'application/json',
};
const results = await fetch(`${GLEAN}/client/v1/search`, {
method: 'POST', headers: searchHeaders,
body: JSON.stringify({
query: 'onboarding getting started',
pageSize: 10,
requestOptions: { datasourceFilter: 'my_wiki' },
}),
}).then(r => r.json());
results.results?.forEach((r: any) => {
console.log(`${r.title} (${r.url}) — score: ${r.score}`);
});
Document indexed.
Getting Started Guide (https://wiki.company.com/getting-started) — score: 0.95
| Error | Cause | Solution |
|---|---|---|
datasource not found | Datasource not created | Run adddatasource first |
| No search results | Indexing not yet complete | Wait 1-2 minutes for processing |
invalid document | Missing required fields | Include id, title, url |
Proceed to glean-local-dev-loop for development workflow setup.