Skip to main content
Glama
mrchris2000

MCP DevOps Plan Server

by mrchris2000

get_sprints

Retrieve the list of sprints for a specific application in DevOps Plan systems to track development cycles and project progress.

Instructions

Get the list of sprints in Plan for a given application

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
applicationYesName of the application

Implementation Reference

  • The implementation of the `get_sprints` tool, which queries the Plan server for sprints.
    server.tool(
        "get_sprints",
        "Get the list of sprints in Plan for a given application",
        {
            application: z.string().describe("Name of the application")
        },
        async ({ application }) => {
            try {
                if (!globalCookies) {
                    globalCookies = await getCookiesFromServer(serverURL);
                    if (!globalCookies) {
                        console.error("Failed to retrieve cookies from server.");
                        return { error: "Failed to retrieve cookies." };
                    }
                    console.log("Received Cookies:", globalCookies);
                } else {
                    console.log("Reusing Stored Cookies:", globalCookies);
                }
    
                const queryPayload = {
                    queryDef: {
                        primaryEntityDefName: "Sprint",
                        queryFieldDefs: [
                            { fieldPathName: "Name", isShown: true, sortOrder: 0 },
                            { fieldPathName: "StartDate", isShown: true, sortOrder: 0 },
                            { fieldPathName: "EndDate", isShown: true, sortOrder: 0 },
                            { fieldPathName: "dbid", isShown: true, sortOrder: 0 },
                            { fieldPathName: "record_type", isShown: true, sortOrder: 0 }
                        ],
                        filterNode: {
                            boolOp: "BOOL_OP_AND",
                            fieldFilters: [],
                            childFilterNodes: []
                        }
                    },
                    resultSetOptions: {
                        convertToLocalTime: false,
                        maxResultSetRows: 10000,
                        pageSize: 10000
                    }
                };
    
                const queryResponse = await fetch(`${serverURL}/ccmweb/rest/repos/${teamspaceID}/databases/${application}/query`, {
                    method: 'POST',
                    headers: {
                        'Content-Type': 'application/json',
                        'Authorization': `Basic ${personal_access_token_string}`,
                        'Cookie': globalCookies
                    },
                    body: JSON.stringify(queryPayload)
                , ...getAgentOptions(serverURL)
                });
    
                const queryData = await queryResponse.json();
                const resultSetId = queryData.result_set_id;
    
                if (!resultSetId) {
                    throw new Error(`Failed to retrieve result set ID. Response: ${JSON.stringify(queryData)}`);
                }
    
                const sprintsResponse = await fetch(`${serverURL}/ccmweb/rest/repos/${teamspaceID}/databases/${application}/query/${resultSetId}`, {
                    method: 'GET',
                    headers: {
                        'Content-Type': 'application/json',
                        'Authorization': `Basic ${personal_access_token_string}`,
                        'Cookie': globalCookies
                    }
                , ...getAgentOptions(serverURL)
                });
    
                const sprintsData = await sprintsResponse.json();
    
                if (sprintsData && sprintsData.rows) {
                    return {
                        content: [{ type: 'text', text: `Sprints retrieved: ${JSON.stringify(sprintsData)}` }]
                    };
                } else {
                    throw new Error("Failed to retrieve sprints");
                }
            } catch (e) {
                return {
                    content: [{ type: 'text', text: `Error retrieving sprints: ${e.message}` }]
                };
            }
        }
    )

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/mrchris2000/mcp-devops-plan'

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