Skip to main content
Glama

get_prompt_partial

Read-onlyIdempotent

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

TableJSON Schema
NameRequiredDescriptionDefault
prompt_partial_idYesPrompt partial ID or slug to retrieve

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okYesWhether the tool call succeeded and returned structured data
dataNoStructured success payload when ok is true
errorNoStructured error payload when ok is false

Implementation Reference

  • 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,
    					),
    				},
    			],
    		};
    	},
  • 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"),
    },
  • 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)}`,
    	);
    }
  • 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;
    }
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description adds value beyond the annotations by specifying what the tool returns ('the stored string plus version metadata') and its purpose (pre-embedding/update check). Annotations already declare readOnlyHint=true, destructiveHint=false, idempotentHint=true, and openWorldHint=true, so safety is clear. The description does not contradict any annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description consists of two sentences, both front-loaded with key information. The first sentence states the core action and objective. The second sentence provides usage guidance and return details. Every phrase earns its place; there is no wasted text.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool has one required parameter and an output schema. The description covers the main use case (fetching content and version details) and advises when to use it. Given the low complexity and the presence of an output schema, the description is sufficient. It could briefly mention that the partial is from a prompt_template, but that is not necessary.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has one parameter (prompt_partial_id) with a description already provided ('Prompt partial ID or slug to retrieve'). Schema description coverage is 100%. The tool description does not add additional meaning beyond what the schema already provides, so a baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Fetch a partial's content and current version details') and specifies the resource (a partial). It distinguishes itself from siblings like list_prompt_partials (which lists all partials) and get_prompt (which retrieves a prompt). The verb 'Fetch' is specific and unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly advises when to use this tool: 'Use this before embedding, updating, or checking what {{> partial_name}} resolves to'. This provides clear context for invocation. It does not explicitly mention alternatives, but the context implies that for listing all partials one would use list_prompt_partials, and for mutations one would use create/update_prompt_partial.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/s-b-e-n-s-o-n/portkey-admin-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server