kugamon/salesforce-core-skills / plugins/salesforce-core/skills/sf-metadata
sf-metadata
VerifiedSalesforce metadata operations expert. Use when creating custom objects, fields, validation rules, record types, permission sets, or querying org metadata structures via a Salesforce MCP server. Do NOT use for comparing metadata across two orgs (use sf-orgdiff), Named or External Credentials and Platform Events (use sf-integration), or querying and loading records (use sf- data). Usage: /sf-metadata [create|update|delete|describe] {ObjectName|FieldName|type} ...
references/mcp-pagination.md
View on GitHub# Handling Large MCP Responses
When an MCP tool response exceeds ~75 k characters, the server stores the
full result as an **artifact** and returns a truncated preview with
retrieval metadata:
```json
{
"records": [
/* up to 3 preview records */
],
"instructions": {
"artifactId": "abc123",
"artifactUrl": "https://..."
},
"_pagination": {
"nextCursor": "cursor_string"
}
}
```
Any tool that returns data can produce an artifact — `soql_query`,
`tooling_api_query`, `metadata_read`, `sobject_describe`, etc.
---
## Detecting an artifact response
Check for `instructions.artifactId` in the response. If present, the full
data was **not** returned inline — only a preview was included.
The response may also contain:
- `instructions.artifactUrl` — a signed URL to download the full dataset.
- `_pagination.nextCursor` — a cursor for paging through the artifact.
---
## Retrieval by execution mode
| Mode | Strategy |
| ------------------------- | ----------------------------------------------------------------------- |
| `sfdx-repo` | Data is on disk — artifact responses are uncommon. |
| `cli` | Data retrieved via CLI — artifact responses are uncommon. |
| `mcp-plus-code-execution` | Fetch `instructions.artifactUrl` and write the JSON to a local file. |
| `mcp-core` | Page through with `fetch_more(artifactId=..., cursor=...)` (see below). |
### `mcp-plus-code-execution` — download the artifact
Fetch the signed URL and save the result locally:
```
# Pseudocode — use whatever HTTP fetch is available in the environment
response = fetch(instructions.artifactUrl)
write("./output/artifact_abc123.json", response.body)
```
This gives you the **complete dataset** in a single request, ready for
local processing (scoring scripts, jq transforms, report generation).
### `mcp-core` — paginate with `fetch_more`
When you cannot download URLs, page through the artifact:
```
fetch_more(
artifactId = instructions.artifactId,
cursor = _pagination.nextCursor
)
```
**`cursor` is required.** Calling `fetch_more` without a cursor will
return an error. Always pass the `nextCursor` from the previous response's
`_pagination` object.
Each page returns the next chunk of data plus a new `_pagination.nextCursor`
(if more pages remain). Process each page immediately and discard it before
fetching the next to manage context size.
---
## Best practices
1. **Check every MCP response** for `instructions.artifactId` — any tool
can produce an artifact when the result is large enough.
2. **Prefer `artifactUrl` download** when the environment supports it —
it is faster and avoids loading large datasets into the conversation.
3. **In `mcp-core`**, process and discard each page before fetching the
next. Never hold more than one or two pages in context simultaneously.
4. **Artifacts expire after 1 hour.** If you get an expiry error, re-run
the original query to generate a fresh artifact.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |