delete_api
Remove a registered API and all associated data including endpoints, embeddings, dependency graphs, and authentication credentials from the JitAPI server.
Instructions
Delete a registered API and all its data including endpoints, embeddings, dependency graph, and authentication credentials.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| api_id | Yes | The API identifier to delete |
Implementation Reference
- src/jitapi/mcp/tools.py:591-623 (handler)The handler function `_delete_api` which implements the tool logic for deleting an API.
async def _delete_api(self, args: dict[str, Any]) -> ToolResult: """Delete an API and all its data.""" api_id = args["api_id"] # Check if API exists if not self.spec_store.api_exists(api_id): return ToolResult( success=False, data=None, error=f"API not found: {api_id}", ) # Track what was deleted deleted = { "spec": False, "graph": False, "embeddings": 0, "auth": False, } # Delete from spec store (includes endpoints) deleted["spec"] = self.spec_store.delete_api(api_id) # Delete from graph store deleted["graph"] = self.graph_store.delete_graph(api_id) # Delete from vector store deleted["embeddings"] = self.vector_store.delete_api(api_id) # Delete auth credentials deleted["auth"] = self.auth_handler.remove_auth(api_id) logger.info(f"Deleted API {api_id}: {deleted}") - src/jitapi/mcp/models.py:159-168 (schema)The `DeleteApiInput` Pydantic model defining the input schema for the `delete_api` tool.
class DeleteApiInput(BaseModel): """Input for delete_api tool.""" api_id: str = Field( ..., description="The API identifier to delete", min_length=1, max_length=100, pattern=r"^[a-zA-Z0-9_-]+$", ) - src/jitapi/mcp/tools.py:294-294 (registration)Registration of the `delete_api` tool within the MCP tool mapping dictionary.
"delete_api": self._delete_api,