Skip to main content
Glama
cuongdev
by cuongdev

tag_pipeline_resource

Add or update tags on AWS CodePipeline resources to organize, track, and manage pipelines efficiently. Specify pipeline name and tag key-value pairs for precise resource identification.

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: retrieves pipeline ARN and applies tags using AWS CodePipeline SDK, returning success message.
    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), }, ], }; }
  • The input schema and metadata for the tag_pipeline_resource tool, defining parameters 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:195-200 (registration)
    Tool handler registration in the switch statement of the CallToolRequestHandler.
    case "tag_pipeline_resource": { return await tagPipelineResource(codePipelineManager, input as { pipelineName: string; tags: Array<{ key: string; value: string }>; }); }
  • src/index.ts:56-58 (registration)
    Import of the tool handler and schema into the main index file.
    tagPipelineResource, tagPipelineResourceSchema } from "./tools/tag_pipeline_resource.js";
  • src/index.ts:123-123 (registration)
    Inclusion of the tool schema in the list of available tools returned by ListToolsRequestHandler.
    tagPipelineResourceSchema,

Other Tools

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

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