Skip to main content
Glama
kevinuehara

devto-mvp-server

by kevinuehara
service.ts1.27 kB
const BASE_URL = "https://dev.to/api"; export const getArticles = async (tags: string, quantity: number) => { try { const response = await fetch( `${BASE_URL}/articles?tag=${tags}&per_page=${quantity}` ); const data = await response.json(); return { content: [ { type: "text" as const, text: JSON.stringify(data, null, 2), }, ], }; } catch (error) { return { content: [ { type: "text" as const, text: `Error fetching articles data: ${ error instanceof Error ? error.message : "Unknown error" }`, }, ], }; } }; export const getArticlesByUserName = async (userName: string) => { try { const response = await fetch(`${BASE_URL}/articles?username=${userName}`); const data = await response.json(); return { content: [ { type: "text" as const, text: JSON.stringify(data, null, 2), }, ], }; } catch (error) { return { content: [ { type: "text" as const, text: `Error fetching articles data: ${ error instanceof Error ? error.message : "Unknown error" }`, }, ], }; } };

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/kevinuehara/mcp-articles-example'

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