Skip to main content
Glama
open-file.ts706 B
import { API_BASE_URL, TOKEN } from './config' import type { RequestHandlerExtra } from '@modelcontextprotocol/sdk/shared/protocol.js' import type { CallToolResult } from '@modelcontextprotocol/sdk/types.js' export const openFile = async (args: { filename: string }, _extra: RequestHandlerExtra): Promise<CallToolResult> => { const { filename } = args const response = await fetch(`${API_BASE_URL}/open/${filename}`, { method: 'POST', headers: { Authorization: `Bearer ${TOKEN}`, }, }) if (!response.ok) { return { content: [{ type: 'text', text: 'Failed to open file' }], } } return { content: [{ type: 'text', text: 'File opened successfully' }], } }

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/gregkonush/mcp-obsidian'

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