Skip to main content
Glama

project_details

Retrieve project metadata including name, terms count, and last activity to prepare for translation management operations in POEditor.

Instructions

Retrieve project metadata such as name, terms count, and last activity. Useful before performing other operations on the project.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idNo

Implementation Reference

  • Handler function for the 'project_details' tool. It resolves the project ID using the helper, calls the POEditor API endpoint 'projects/view', extracts the project object from the response, and returns it formatted as JSON text content.
    async (args) => { const id = requireProjectId(args.project_id ?? null); const res = await poeditor("projects/view", { id: String(id) }); const project = res.result?.project ?? res.result ?? {}; return { content: [{ type: "text", text: JSON.stringify(project, null, 2) }] }; }
  • Zod input schema for the 'project_details' tool, accepting an optional positive integer project_id.
    const ProjectDetailsInput = z.object({ project_id: z.number().int().positive().optional() });
  • src/server.ts:140-150 (registration)
    Registration of the 'project_details' tool on the MCP server using server.tool(), including the tool name, description, input schema reference, and inline handler implementation.
    server.tool( "project_details", "Retrieve project metadata such as name, terms count, and last activity. Useful before performing other operations on the project.", ProjectDetailsInput.shape, async (args) => { const id = requireProjectId(args.project_id ?? null); const res = await poeditor("projects/view", { id: String(id) }); const project = res.result?.project ?? res.result ?? {}; return { content: [{ type: "text", text: JSON.stringify(project, null, 2) }] }; } );
  • Helper function used by the project_details handler (and others) to resolve the project ID from tool arguments or the POEDITOR_PROJECT_ID environment variable.
    function requireProjectId(argProjectId?: number | null) { const id = argProjectId ?? (PROJECT_ID ? Number(PROJECT_ID) : null); if (!id) throw new Error("project_id is required (either pass it to the tool or set POEDITOR_PROJECT_ID)"); return id; }
  • Core helper function for making authenticated API requests to POEditor, used by the project_details handler to fetch project details.
    export async function poeditor(endpoint: string, form: Record<string, string>) { const body = new URLSearchParams({ api_token: API_TOKEN!, ...form }); const { body: resBody } = await request(`${API_BASE}/${endpoint}`, { method: "POST", headers: { "Content-Type": "application/x-www-form-urlencoded" }, body: body.toString() }); const text = await resBody.text(); let json: any; try { json = JSON.parse(text); } catch (e) { throw new Error(`POEditor: invalid JSON response: ${text}`); } const status = json?.response?.status; if (status !== "success") { const code = json?.response?.code; const message = json?.response?.message || "Unknown POEditor error"; throw new Error(`POEditor API error ${code ?? ""}: ${message}`); } return json; }

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/ryan-shaw/poeditor-mcp'

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