Skip to main content
Glama
cuongdev
by cuongdev

tag_pipeline_resource

Add or update tags for AWS CodePipeline resources to organize, track costs, and manage access control across pipeline components.

Instructions

Add or update tags for a pipeline resource

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pipelineNameYesName of the pipeline
tagsYesList of tags to add or update

Implementation Reference

  • The main handler function that executes the tool logic: retrieves pipeline ARN and applies tags using AWS CodePipeline SDK.
    export async function tagPipelineResource( codePipelineManager: CodePipelineManager, input: { pipelineName: string; tags: Array<{ key: string; value: string }>; } ) { const { pipelineName, tags } = input; const codepipeline = codePipelineManager.getCodePipeline(); // First, get the pipeline ARN const pipelineResponse = await codepipeline.getPipeline({ name: pipelineName }).promise(); const resourceArn = pipelineResponse.metadata?.pipelineArn; if (!resourceArn) { throw new Error(`Could not find ARN for pipeline: ${pipelineName}`); } // Tag the resource await codepipeline.tagResource({ resourceArn, tags: tags.map(tag => ({ key: tag.key, value: tag.value })) }).promise(); return { content: [ { type: "text", text: JSON.stringify({ message: "Pipeline resource tagged successfully", resourceArn, tags }, null, 2), }, ], }; }
  • Input schema definition for the tag_pipeline_resource tool, specifying pipelineName and tags array.
    export const tagPipelineResourceSchema = { name: "tag_pipeline_resource", description: "Add or update tags for a pipeline resource", inputSchema: { type: "object", properties: { pipelineName: { type: "string", description: "Name of the pipeline" }, tags: { type: "array", description: "List of tags to add or update", items: { type: "object", properties: { key: { type: "string", description: "Tag key" }, value: { type: "string", description: "Tag value" } }, required: ["key", "value"] } } }, required: ["pipelineName", "tags"], }, } as const;
  • src/index.ts:110-128 (registration)
    Registration of the tool schema in the list of available tools returned by ListToolsRequest handler.
    server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: [ listPipelinesSchema, getPipelineStateSchema, listPipelineExecutionsSchema, approveActionSchema, retryStageSchema, triggerPipelineSchema, getPipelineExecutionLogsSchema, stopPipelineExecutionSchema, // Add new tool schemas getPipelineDetailsSchema, tagPipelineResourceSchema, createPipelineWebhookSchema, getPipelineMetricsSchema, ], }; });
  • src/index.ts:195-200 (registration)
    Dispatch registration mapping tool name to handler function in the CallToolRequest handler switch statement.
    case "tag_pipeline_resource": { return await tagPipelineResource(codePipelineManager, input as { pipelineName: string; tags: Array<{ key: string; value: string }>; }); }

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/cuongdev/mcp-codepipeline-server'

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