@smartbear/mcp
Version:
MCP server for interacting SmartBear Products
40 lines (39 loc) • 1.27 kB
JavaScript
import { getProjectParams, getProjectResponse, } from "../../common/rest-api-schemas.js";
export class GetProject {
apiClient;
constructor(apiClient) {
this.apiClient = apiClient;
}
specification = {
title: "Get Project",
summary: "Get details of project specified by id or key in Zephyr",
readOnly: true,
idempotent: true,
inputSchema: getProjectParams,
outputSchema: getProjectResponse,
examples: [
{
description: "Get the project with id 1",
parameters: {
projectIdOrKey: "1",
},
expectedOutput: "The project with its details",
},
{
description: "Get the project with key 'PROJ'",
parameters: {
projectIdOrKey: "PROJ",
},
expectedOutput: "The project with its details",
},
],
};
handle = async (args) => {
const { projectIdOrKey } = getProjectParams.parse(args);
const response = await this.apiClient.get(`/projects/${projectIdOrKey}`);
return {
structuredContent: response,
content: [],
};
};
}