Skip to main content
Glama

mcp-gitlab

by atla-digital
files.ts833 B
/** * File and repository content handler functions */ import { McpError, ErrorCode } from "@modelcontextprotocol/sdk/types.js"; import { ToolHandler } from "../../../utils/handler-types.js"; import { formatResponse } from "../../../utils/response-formatter.js"; /** * Get repository file handler */ export const getRepositoryFile: ToolHandler = async (params, context) => { const { project_id, file_path, ref } = params.arguments || {}; if (!project_id || !file_path) { throw new McpError(ErrorCode.InvalidParams, 'project_id and file_path are required'); } const response = await context.axiosInstance.get( `/projects/${encodeURIComponent(String(project_id))}/repository/files/${encodeURIComponent(String(file_path))}`, { params: { ref: ref || 'main' } } ); return formatResponse(response.data); };

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/atla-digital/mcp-gitlab'

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