Add MCP tools to list, id-list, and delete source assets - #1096
Open
ehoogerbeets wants to merge 1 commit into
Open
ehoogerbeets wants to merge 1 commit into
ehoogerbeets wants to merge 1 commit into
Conversation
These cover GET /api/assets, GET /api/assets/ids, and DELETE /api/assets/{id} without the localize endpoints.
Co-authored-by: Cursor <cursoragent@cursor.com>
2 tasks done
ehoogerbeets
added this pull request to stack #1102
September 24, 2026 23:04
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What an asset is
In Mojito, an asset is one source resource file inside a repository — the English (or other source-locale) file that contains the strings to translate. Typical examples are
messages.properties,en.lproj/Localizable.strings, orres/values/strings.xml. Mojito identifies it by a logical path (the path stored in the TM, not necessarily a path on the agent's machine) that is unique within that repository.It is not a localized copy (
messages_fr-FR.properties), and it is not an individual string. Extraction splits the asset's content into text units (the rows translators see in the workbench). The previous PR in this stack (mojito_asset_import) uploads one of these files; this PR is how an agent lists what is already there and deletes one by id.What this adds
Three MCP tools around existing source assets:
mojito_asset_list— summaries of the source files in a repositorymojito_asset_ids— the same query, but only numeric idsmojito_asset_delete— remove one asset by idUntil now the only asset tool was import. An agent could push a file in, but could not answer “what source files does this Mojito repo already have?” or remove one that was uploaded by mistake.
What the underlying APIs do
GET /api/assetsreturns the full filtered set of asset summaries in one response (id, logical path, deleted/virtual flags, repository, last successful extraction, created-by). It is not paginated — same reason as repository list: do not pass--paginate.repositoryIdis required. Optional filters:path— exact logical path (e.g.src/main/resources/messages.properties)deleted—trueonly deleted,falseonly live, omit bothvirtual—trueonly virtual assets,falseonly real files, omit bothbranchId— assets associated with that Mojito branchThere is no GET-by-id for a single asset. To resolve a path, filter list with that path. To go from an id back to a path, use list, not ids.
GET /api/assets/idsuses the same query fields and returns a flat list of numbers ([12, 13, …]). Cheaper when the caller already knows it only needs ids.DELETE /api/assets/{assetId}deletes one asset. Successful empty CLI stdout maps tonull. This is a single-id delete, not the bulk unused-asset cleanup CLI push uses (DELETE /api/assetswith a body of ids). That bulk endpoint is intentionally not exposed: an agent deleting one file should not sweep the rest of the repository.Why an agent would use them
Typical flow after import: list the repo to confirm the new path is there, or to pick which file to talk about when the user says “the properties file.” Use ids when you are about to delete and only need the number. Delete is for “remove this source file from Mojito” after confirming environment and id — prefer
mojito-devwhile experimenting.Localize, bulk unused-asset cleanup, and XLIFF export stay out of this slice.
Test plan
cd mojito-mcp && pnpm testcd mojito-mcp && pnpm run buildMade with Cursor