polib MCP Server 0.1.0
A server to read and write PO files using polib
Endpoints
POST /po/read
Read Po
Description Return every entry from the requested PO file.
Request body
application/json
{
"file_path": "string"
}
This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.
Schema of the request body
{
"properties": {
"file_path": {
"type": "string",
"title": "File Path",
"description": "Absolute path to the .po file to read."
}
},
"type": "object",
"required": [
"file_path"
],
"title": "ReadPORequest"
}
Response 200 OK
application/json
{
"entries": [
{
"msgid": "string",
"msgstr": "string",
"msgctxt": null,
"comment": null,
"tcomment": null,
"occurrences": [
"string"
],
"flags": [
"string"
]
}
]
}
This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.
Schema of the response body
{
"properties": {
"entries": {
"items": {
"$ref": "#/components/schemas/POEntry"
},
"type": "array",
"title": "Entries",
"description": "List of entries parsed from the PO file."
}
},
"type": "object",
"required": [
"entries"
],
"title": "ReadPOResponse"
}
Response 422 Unprocessable Entity
application/json
{
"detail": [
{
"loc": [
null
],
"msg": "string",
"type": "string"
}
]
}
This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.
Schema of the response body
{
"properties": {
"detail": {
"items": {
"$ref": "#/components/schemas/ValidationError"
},
"type": "array",
"title": "Detail"
}
},
"type": "object",
"title": "HTTPValidationError"
}
POST /po/write
Write Po
Description Create or update entries in a PO file and format it with powrap.
Request body
application/json
{
"file_path": "string",
"entries": [
{
"msgid": "string",
"msgstr": "string",
"msgctxt": null,
"comment": null,
"tcomment": null,
"occurrences": [
"string"
],
"flags": [
"string"
]
}
]
}
This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.
Schema of the request body
{
"properties": {
"file_path": {
"type": "string",
"title": "File Path",
"description": "Absolute path to the .po file to write."
},
"entries": {
"items": {
"$ref": "#/components/schemas/POEntry"
},
"type": "array",
"title": "Entries",
"description": "List of entries to write to the PO file."
}
},
"type": "object",
"required": [
"file_path",
"entries"
],
"title": "WritePORequest"
}
Response 200 OK
application/json
{
"success": true,
"message": "string"
}
This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.
Schema of the response body
{
"properties": {
"success": {
"type": "boolean",
"title": "Success",
"description": "Whether the write operation was successful."
},
"message": {
"type": "string",
"title": "Message",
"description": "Status message."
}
},
"type": "object",
"required": [
"success",
"message"
],
"title": "WritePOResponse"
}
Response 422 Unprocessable Entity
application/json
{
"detail": [
{
"loc": [
null
],
"msg": "string",
"type": "string"
}
]
}
This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.
Schema of the response body
{
"properties": {
"detail": {
"items": {
"$ref": "#/components/schemas/ValidationError"
},
"type": "array",
"title": "Detail"
}
},
"type": "object",
"title": "HTTPValidationError"
}
POST /po/read_context
Read Po Context
Description Return the target entry plus its surrounding context window.
Request body
application/json
{
"file_path": "string",
"msgid": "string",
"msgctxt": null,
"context_size": 0
}
This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.
Schema of the request body
{
"properties": {
"file_path": {
"type": "string",
"title": "File Path",
"description": "Absolute path to the .po file to read."
},
"msgid": {
"type": "string",
"title": "Msgid",
"description": "The msgid of the entry to find."
},
"msgctxt": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Msgctxt",
"description": "Optional message context to disambiguate entries with the same msgid."
},
"context_size": {
"type": "integer",
"title": "Context Size",
"description": "Number of entries before and after to include.",
"default": 1
}
},
"type": "object",
"required": [
"file_path",
"msgid"
],
"title": "ReadPOContextRequest"
}
Response 200 OK
application/json
{
"target_entry": null,
"context_before": [
{
"msgid": "string",
"msgstr": "string",
"msgctxt": null,
"comment": null,
"tcomment": null,
"occurrences": [
"string"
],
"flags": [
"string"
]
}
],
"context_after": null
}
This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.
Schema of the response body
{
"properties": {
"target_entry": {
"anyOf": [
{
"$ref": "#/components/schemas/POEntry"
},
{
"type": "null"
}
],
"description": "The requested entry."
},
"context_before": {
"items": {
"$ref": "#/components/schemas/POEntry"
},
"type": "array",
"title": "Context Before",
"description": "Entries preceding the target."
},
"context_after": {
"items": {
"$ref": "#/components/schemas/POEntry"
},
"type": "array",
"title": "Context After",
"description": "Entries succeeding the target."
}
},
"type": "object",
"required": [
"context_before",
"context_after"
],
"title": "ReadPOContextResponse"
}
Response 422 Unprocessable Entity
application/json
{
"detail": [
{
"loc": [
null
],
"msg": "string",
"type": "string"
}
]
}
This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.
Schema of the response body
{
"properties": {
"detail": {
"items": {
"$ref": "#/components/schemas/ValidationError"
},
"type": "array",
"title": "Detail"
}
},
"type": "object",
"title": "HTTPValidationError"
}
POST /po/find_fuzzy
Find Fuzzy
Description List every entry flagged as fuzzy in the provided PO file.
Request body
application/json
{
"file_path": "string"
}
This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.
Schema of the request body
{
"properties": {
"file_path": {
"type": "string",
"title": "File Path",
"description": "Absolute path to the .po file to read."
}
},
"type": "object",
"required": [
"file_path"
],
"title": "FindFuzzyRequest"
}
Response 200 OK
application/json
{
"entries": [
{
"msgid": "string",
"msgstr": "string",
"msgctxt": null,
"comment": null,
"tcomment": null,
"occurrences": [
"string"
],
"flags": [
"string"
]
}
]
}
This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.
Schema of the response body
{
"properties": {
"entries": {
"items": {
"$ref": "#/components/schemas/POEntry"
},
"type": "array",
"title": "Entries",
"description": "List of fuzzy entries found in the PO file."
}
},
"type": "object",
"required": [
"entries"
],
"title": "FindFuzzyResponse"
}
Response 422 Unprocessable Entity
application/json
{
"detail": [
{
"loc": [
null
],
"msg": "string",
"type": "string"
}
]
}
This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.
Schema of the response body
{
"properties": {
"detail": {
"items": {
"$ref": "#/components/schemas/ValidationError"
},
"type": "array",
"title": "Detail"
}
},
"type": "object",
"title": "HTTPValidationError"
}
Schemas
FindFuzzyRequest
| Name | Type |
|---|---|
| file_path | string |
FindFuzzyResponse
| Name | Type |
|---|---|
| entries | Array<POEntry> |
HTTPValidationError
| Name | Type |
|---|---|
| detail | Array<ValidationError> |
POEntry
| Name | Type |
|---|---|
| comment | |
| flags | Array<string> |
| msgctxt | |
| msgid | string |
| msgstr | string |
| occurrences | Array<string> |
| tcomment |
ReadPOContextRequest
| Name | Type |
|---|---|
| context_size | integer |
| file_path | string |
| msgctxt | |
| msgid | string |
ReadPOContextResponse
| Name | Type |
|---|---|
| context_after | Array<POEntry> |
| context_before | Array<POEntry> |
| target_entry |
ReadPORequest
| Name | Type |
|---|---|
| file_path | string |
ReadPOResponse
| Name | Type |
|---|---|
| entries | Array<POEntry> |
ValidationError
| Name | Type |
|---|---|
| loc | Array<> |
| msg | string |
| type | string |
WritePORequest
| Name | Type |
|---|---|
| entries | Array<POEntry> |
| file_path | string |
WritePOResponse
| Name | Type |
|---|---|
| message | string |
| success | boolean |