get_prompt_partial
Retrieve prompt partial content and version metadata to verify or prepare for embedding updates.
Instructions
Fetch a partial's content and current version details. Use this before embedding, updating, or checking what {{> partial_name}} resolves to; returns the stored string plus version metadata.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| prompt_partial_id | Yes | Prompt partial ID or slug to retrieve |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | Whether the tool call succeeded and returned structured data | |
| data | No | Structured success payload when ok is true | |
| error | No | Structured error payload when ok is false |
Implementation Reference
- src/tools/partials.tools.ts:134-166 (handler)The handler function for the 'get_prompt_partial' tool. It calls service.partials.getPromptPartial with the prompt_partial_id parameter and returns the partial data (id, slug, name, string, version, etc.) as JSON.
server.tool( "get_prompt_partial", "Fetch a partial's content and current version details. Use this before embedding, updating, or checking what {{> partial_name}} resolves to; returns the stored string plus version metadata.", PARTIALS_TOOL_SCHEMAS.getPromptPartial, async (params) => { const partial = await service.partials.getPromptPartial( params.prompt_partial_id, ); return { content: [ { type: "text", text: JSON.stringify( { id: partial.id, slug: partial.slug, name: partial.name, collection_id: partial.collection_id, string: partial.string, version: partial.version, version_description: partial.version_description, prompt_partial_version_id: partial.prompt_partial_version_id, status: partial.status, created_at: partial.created_at, last_updated_at: partial.last_updated_at, }, null, 2, ), }, ], }; }, - src/tools/partials.tools.ts:28-32 (schema)Input schema for getPromptPartial: expects a single required string field 'prompt_partial_id' (the partial ID or slug).
getPromptPartial: { prompt_partial_id: z .string() .describe("Prompt partial ID or slug to retrieve"), }, - src/tools/partials.tools.ts:133-167 (registration)Registration of the tool named 'get_prompt_partial' via server.tool(), connecting the name, description, schema, and handler.
// Get partial tool server.tool( "get_prompt_partial", "Fetch a partial's content and current version details. Use this before embedding, updating, or checking what {{> partial_name}} resolves to; returns the stored string plus version metadata.", PARTIALS_TOOL_SCHEMAS.getPromptPartial, async (params) => { const partial = await service.partials.getPromptPartial( params.prompt_partial_id, ); return { content: [ { type: "text", text: JSON.stringify( { id: partial.id, slug: partial.slug, name: partial.name, collection_id: partial.collection_id, string: partial.string, version: partial.version, version_description: partial.version_description, prompt_partial_version_id: partial.prompt_partial_version_id, status: partial.status, created_at: partial.created_at, last_updated_at: partial.last_updated_at, }, null, 2, ), }, ], }; }, ); - The service method that performs the HTTP GET request to /prompts/partials/{partialId} to fetch the partial data.
async getPromptPartial( promptPartialId: string, ): Promise<GetPromptPartialResponse> { return this.get<GetPromptPartialResponse>( `/prompts/partials/${this.encodePathSegment(promptPartialId)}`, ); } - src/services/partials.types.ts:53-65 (schema)TypeScript interface for the response returned by getPromptPartial, defining fields like id, slug, name, string, version, status, etc.
export interface GetPromptPartialResponse { id: string; slug: string; name: string; collection_id?: string; string: string; version: number; version_description?: string; prompt_partial_version_id: string; created_at: string; last_updated_at: string; status: string; }