platform-agentsetup-categories-fetch
forcedotcom/sf-skills
Fetch prompt categories from Salesforce Agentforce using the Connect API.
What is platform-agentsetup-categories-fetch?
Retrieves agentic setup prompt categories from a connected Salesforce org via the Connect API's GET /agenticsetup/categories endpoint. Use this when you need to list available prompt categories, optionally including their nested prompts, for Agentforce setup workflows.
- Calls GET /agenticsetup/categories to retrieve prompt categories from a connected Salesforce org
- Optionally includes nested prompts within each category using the fetchPrompts query parameter
- Parses and presents category names, labels, and associated prompts in a readable format
- Handles authentication errors, disabled features, and API version mismatches with clear error messages
- Requires SF CLI v2.0.0+ and Salesforce API v67.0 or later
How to install platform-agentsetup-categories-fetch
npx skills add https://github.com/forcedotcom/sf-skills --skill platform-agentsetup-categories-fetch- Connected Salesforce org authenticated via sf org login
- SF CLI version 2.0.0 or later installed
- Salesforce API version 67.0 or higher in the target org
- Agentic Setup Categories feature enabled in the org (check Setup > Einstein/Agentforce)
How to use platform-agentsetup-categories-fetch
- 1.Verify org connectivity by running sf org display --json to confirm authentication
- 2.Call the API with sf api request rest /services/data/v67.0/agenticsetup/categories --method GET to fetch categories only
- 3.Optionally add ?fetchPrompts=true to the URL to include nested prompts within each category
- 4.Parse the returned JSON object containing the categories array with name, label, and prompts fields
- 5.Present results showing category count, category list with labels, and nested prompts if requested
Use cases
- List all available prompt categories in Agentforce to understand what setup prompts are available
- Retrieve prompt categories with their nested prompts to display in a copilot or setup interface
- Verify that the Agentic Setup Categories feature is enabled and accessible in a Salesforce org
- Audit which prompt categories exist before creating or managing prompts programmatically
- Salesforce developers building Agentforce integrations
- Admins managing Agentforce setup and prompt libraries
- Agents automating Salesforce org discovery and configuration tasks
platform-agentsetup-categories-fetch FAQ
Without fetchPrompts, the API returns only category metadata (name and label), reducing payload size. With fetchPrompts=true, each category includes its nested prompts array, useful when you need the full prompt library.
The Agentic Setup Categories feature is not enabled for your org or user. Check Setup > Einstein/Agentforce to enable it, then retry the request.
No, this skill is read-only. It only fetches categories via GET. To create or modify categories, you need a different endpoint or tool.
The SF CLI automatically handles Salesforce session tokens from ~/.sfdx, while curl requires manual Authorization headers and is more error-prone.
Default to v67.0, which is the minimum version where this endpoint was introduced. You can specify a newer version if your org supports it.
Full instructions (SKILL.md)
Source of truth, from forcedotcom/sf-skills.
name: platform-agentsetup-categories-fetch description: "Fetch agentic setup prompt categories from a connected Salesforce org using the Connect API. Use this skill to call GET /agenticsetup/categories and return the list of prompt categories, optionally with their nested prompts. TRIGGER when: user asks to get, fetch, list, or show agentic setup categories, prompt categories, setup copilot categories, prompt library categories, available setup prompts, Agentforce prompt library, or copilot prompts. DO NOT TRIGGER when: user wants to create new categories, work with non-categories endpoints, or generate OpenAPI specs." allowed-tools: Bash Read metadata: cliTools: - tool: ["sf"] semver: ">=2.0.0" version: "1.0" domains: ["Platform", "Agentforce"] minApiVersion: "67.0"
platform-agentsetup-categories-fetch
Fetch prompt categories from the Agentic Setup Categories Connect API on a connected Salesforce org.
Scope
In scope:
- Calling
GET /services/data/{apiVersion}/agenticsetup/categoriesvia SF CLI - Passing the
fetchPromptsquery parameter to include nested prompts - Parsing and presenting the JSON response (categories, labels, prompts)
- Handling errors (403 when feature is disabled, auth failures)
Out of scope — delegate elsewhere:
- Creating or modifying prompt categories → not supported via this API (read-only)
- Org authentication setup → use
sf org loginseparately - Permission set assignment → assigning-permission-set
Required Inputs
The agent needs:
- A connected org (already authenticated via
sf org login) - Optionally: whether to include nested prompts (
fetchPrompts=true) - Optionally: target API version (default: v67.0). Replace
v67.0in the URL with the user-specified version if provided.
Workflow
1. Verify org connectivity
sf org display --json
Confirm the org is authenticated and extract the instance URL. If no default org is set, ask the user which org to target with --target-org.
2. Call the Categories API
Basic call (categories only):
sf api request rest /services/data/v67.0/agenticsetup/categories --method GET
With nested prompts:
sf api request rest "/services/data/v67.0/agenticsetup/categories?fetchPrompts=true" --method GET
3. Parse and present the response
The API returns a JSON object with a categories array. Each category has name, label, and prompts fields. See references/api-response-schema.md for the full response structure and examples for both fetchPrompts=true and fetchPrompts=false.
Present the results clearly:
- List categories with their name and label
- If
fetchPrompts=truewas used, show nested prompts under each category - Note any categories with empty
promptsarrays (means no prompts exist for that category)
4. Handle errors
| Error | Meaning | Action |
|---|---|---|
| Success (exit 0) | 200 OK | Parse and display results |
FUNCTIONALITY_NOT_ENABLED | Feature not enabled for this org/user | Tell user the Agentic Setup Categories feature needs to be enabled — check Setup > Einstein/Agentforce |
INVALID_SESSION_ID | Session expired | Re-authenticate with sf org login |
NOT_FOUND | Endpoint not found | API version too old or feature not deployed to this org |
Rules / Constraints
| Rule | Rationale |
|---|---|
Always use sf api request rest — never curl or raw HTTP | curl bypasses ~/.sfdx session tokens and requires manual Authorization headers, making it brittle |
| NEVER use SOQL queries | Categories are NOT in standard objects — only available via this Connect REST API |
| NEVER generate files (LWC, Apex, XML) | This is a data-fetching task, not a code generation task |
| Default to v67.0 unless user specifies | This is the min-version where the endpoint was introduced |
| Don't pass fetchPrompts unless asked | Reduces payload size; prompts can be large |
| Categories are sorted by label | The API returns them alphabetically — don't re-sort |
| Prompts are sorted by text | Within each category, prompts come alphabetically |
Output Expectations
When finishing, present:
- Number of categories returned
- Category list — name and label for each
- Prompts (if requested) — nested under their category
- Any errors encountered with suggested fixes
Reference File Index
| File | When to read |
|---|---|
references/api-response-schema.md | When you need to understand the full response structure and field descriptions |
Related skills
More from forcedotcom/sf-skills and the wider catalog.

platform-apex-anonymous-run
Run anonymous Apex against your Salesforce org, capture debug logs, and surface errors instantly.

platform-apex-generate
Primary Apex authoring skill for class generation, refactoring, and code review.

platform-apex-logs-debug
Analyze Salesforce debug logs to diagnose governor limits, stack traces, and performance bottlenecks.

platform-apex-test-generate
Generate and validate Apex test classes with TestDataFactory patterns, bulk testing, mocking, and coverage analysis.

platform-apex-test-run
Run Apex tests, analyze coverage, and fix failures in Salesforce with structured test-fix loops.

platform-architecture-analyze
Holistic Well-Architected review of Salesforce DX projects: grades observable code/metadata criteria and emits governance checklist.