Agent skill
glean-core-workflow-a
Execute Glean primary workflow: search, chat, and AI-powered answers across enterprise data. Use when building search integrations, implementing Glean chat, or creating AI assistants. Trigger: "glean search API", "glean chat", "glean AI answers", "enterprise search".
Install this agent skill to your Project
npx add-skill https://github.com/jeremylongshore/claude-code-plugins-plus-skills/tree/main/plugins/saas-packs/glean-pack/skills/glean-core-workflow-a
SKILL.md
Glean Core Workflow A: Search & Chat
Overview
Build search and chat experiences using the Glean Client API. Covers full-text search with filters, AI-powered chat answers, and autocomplete suggestions.
Instructions
Step 1: Search with Filters and Facets
const results = await fetch(`${GLEAN}/client/v1/search`, {
method: 'POST', headers: searchHeaders,
body: JSON.stringify({
query: 'kubernetes deployment best practices',
pageSize: 20,
requestOptions: {
datasourceFilter: 'confluence,github',
facetFilters: [{ fieldName: 'author', values: ['engineering-team'] }],
},
}),
}).then(r => r.json());
results.results?.forEach((r: any) => {
console.log(`[${r.datasource}] ${r.title}`);
console.log(` ${r.snippets?.[0]?.snippet ?? ''}`);
});
Step 2: AI Chat (Glean Assistant)
const chatResponse = await fetch(`${GLEAN}/client/v1/chat`, {
method: 'POST', headers: searchHeaders,
body: JSON.stringify({
messages: [{ role: 'USER', content: 'What is our deployment process for production?' }],
applicationId: 'my-app',
}),
}).then(r => r.json());
console.log('Answer:', chatResponse.messages?.[0]?.content);
console.log('Sources:', chatResponse.citations?.map((c: any) => c.title).join(', '));
Step 3: Autocomplete / Suggestions
const suggestions = await fetch(`${GLEAN}/client/v1/autocomplete`, {
method: 'POST', headers: searchHeaders,
body: JSON.stringify({ query: 'deploy', datasourceFilter: 'confluence' }),
}).then(r => r.json());
suggestions.results?.forEach((s: any) => console.log(` ${s.text}`));
Error Handling
| Error | Cause | Solution |
|---|---|---|
| Empty results | Query too specific or datasource not indexed | Broaden query, check datasource status |
| Chat returns no citations | Content not indexed for chat | Verify documents have body text |
| 403 on search | User permissions | Ensure token has search scope |
Resources
Next Steps
For bulk indexing workflow, see glean-core-workflow-b.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
dockerfile-generator
Dockerfile Generator - Auto-activating skill for DevOps Basics. Triggers on: dockerfile generator, dockerfile generator Part of the DevOps Basics skill category.
branch-naming-helper
Branch Naming Helper - Auto-activating skill for DevOps Basics. Triggers on: branch naming helper, branch naming helper Part of the DevOps Basics skill category.
readme-generator
Readme Generator - Auto-activating skill for DevOps Basics. Triggers on: readme generator, readme generator Part of the DevOps Basics skill category.
makefile-generator
Makefile Generator - Auto-activating skill for DevOps Basics. Triggers on: makefile generator, makefile generator Part of the DevOps Basics skill category.
gitignore-generator
Gitignore Generator - Auto-activating skill for DevOps Basics. Triggers on: gitignore generator, gitignore generator Part of the DevOps Basics skill category.
pre-commit-hook-setup
Pre Commit Hook Setup - Auto-activating skill for DevOps Basics. Triggers on: pre commit hook setup, pre commit hook setup Part of the DevOps Basics skill category.
Didn't find tool you were looking for?