Skip to main content
Glama
mrchris2000

MCP DevOps Plan Server

by mrchris2000

get_applications

Retrieve all applications from the DevOps Plan system to manage and view available software projects and components.

Instructions

Retrieves all applications from the Plan system

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The implementation of the get_applications tool, which retrieves applications by querying the Plan system's databases API endpoint.
    server.tool(
        "get_applications",
        "Retrieves all applications from the Plan system",
        {},
        async () => {
            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); // Print cookies after receiving
                } else {
                    console.log("Reusing Stored Cookies:", globalCookies); // Print when reusing stored cookies
                }
                const response = await fetch(`${serverURL}/ccmweb/rest/repos/${teamspaceID}/databases`, {
                    method: 'GET',
                    headers: {
                        'Content-Type': 'application/json',
                        'Accept': 'application/json',
                        'Authorization': `Basic ${personal_access_token_string}`,
                        'Cookie': globalCookies
                    }
                });
    
                const data = await response.json();
    
                if (data && Array.isArray(data)) {
                    const applications = data.map(app => ({
                        id: app.dbId,
                        applicationName: app.name
                    }));
    
                    return {
                        content: [
                            { type: 'text', text: `Applications retrieved: ${JSON.stringify(applications)}` }
                        ]
                    };
                } else {
                    throw new Error("Failed to retrieve applications");
                }
            } catch (e) {
                return {
                    content: [{ type: 'text', text: `Error retrieving applications: ${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