diff --git a/docker/toolkits.txt b/docker/toolkits.txt index a8a2b463..b09211fa 100644 --- a/docker/toolkits.txt +++ b/docker/toolkits.txt @@ -1,6 +1,7 @@ arcade-airtable-api arcade-box-api arcade-calendly-api +arcade-cursor-agents-api arcade-freshservice-api arcade-miro-api arcade-slack-api diff --git a/toolkits/cursor_agents_api/.pre-commit-config.yaml b/toolkits/cursor_agents_api/.pre-commit-config.yaml new file mode 100644 index 00000000..40c38418 --- /dev/null +++ b/toolkits/cursor_agents_api/.pre-commit-config.yaml @@ -0,0 +1,18 @@ +files: ^.*/cursor_agents_api/.* +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: "v4.4.0" + hooks: + - id: check-case-conflict + - id: check-merge-conflict + - id: check-toml + - id: check-yaml + - id: end-of-file-fixer + - id: trailing-whitespace + + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.6.7 + hooks: + - id: ruff + args: [--fix] + - id: ruff-format diff --git a/toolkits/cursor_agents_api/.ruff.toml b/toolkits/cursor_agents_api/.ruff.toml new file mode 100644 index 00000000..9519fe6c --- /dev/null +++ b/toolkits/cursor_agents_api/.ruff.toml @@ -0,0 +1,44 @@ +target-version = "py310" +line-length = 100 +fix = true + +[lint] +select = [ + # flake8-2020 + "YTT", + # flake8-bandit + "S", + # flake8-bugbear + "B", + # flake8-builtins + "A", + # flake8-comprehensions + "C4", + # flake8-debugger + "T10", + # flake8-simplify + "SIM", + # isort + "I", + # mccabe + "C90", + # pycodestyle + "E", "W", + # pyflakes + "F", + # pygrep-hooks + "PGH", + # pyupgrade + "UP", + # ruff + "RUF", + # tryceratops + "TRY", +] + +[lint.per-file-ignores] +"**/tests/*" = ["S101"] + +[format] +preview = true +skip-magic-trailing-comma = false diff --git a/toolkits/cursor_agents_api/LICENSE b/toolkits/cursor_agents_api/LICENSE new file mode 100644 index 00000000..dfbb8b76 --- /dev/null +++ b/toolkits/cursor_agents_api/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025, Arcade AI + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/toolkits/cursor_agents_api/Makefile b/toolkits/cursor_agents_api/Makefile new file mode 100644 index 00000000..86da492a --- /dev/null +++ b/toolkits/cursor_agents_api/Makefile @@ -0,0 +1,54 @@ +.PHONY: help + +help: + @echo "🛠️ github Commands:\n" + @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' + +.PHONY: install +install: ## Install the uv environment and install all packages with dependencies + @echo "🚀 Creating virtual environment and installing all packages using uv" + @uv sync --active --all-extras --no-sources + @if [ -f .pre-commit-config.yaml ]; then uv run --no-sources pre-commit install; fi + @echo "✅ All packages and dependencies installed via uv" + +.PHONY: install-local +install-local: ## Install the uv environment and install all packages with dependencies with local Arcade sources + @echo "🚀 Creating virtual environment and installing all packages using uv" + @uv sync --active --all-extras + @if [ -f .pre-commit-config.yaml ]; then uv run pre-commit install; fi + @echo "✅ All packages and dependencies installed via uv" +.PHONY: build +build: clean-build ## Build wheel file using poetry + @echo "🚀 Creating wheel file" + uv build + +.PHONY: clean-build +clean-build: ## clean build artifacts + @echo "🗑️ Cleaning dist directory" + rm -rf dist + +.PHONY: test +test: ## Test the code with pytest + @echo "🚀 Testing code: Running pytest" + @uv run --no-sources pytest -W ignore -v --cov --cov-config=pyproject.toml --cov-report=xml + +.PHONY: coverage +coverage: ## Generate coverage report + @echo "coverage report" + @uv run --no-sources coverage report + @echo "Generating coverage report" + @uv run --no-sources coverage html + +.PHONY: bump-version +bump-version: ## Bump the version in the pyproject.toml file by a patch version + @echo "🚀 Bumping version in pyproject.toml" + uv version --no-sources --bump patch + +.PHONY: check +check: ## Run code quality tools. + @if [ -f .pre-commit-config.yaml ]; then\ + echo "🚀 Linting code: Running pre-commit";\ + uv run --no-sources pre-commit run -a;\ + fi + @echo "🚀 Static type checking: Running mypy" + @uv run --no-sources mypy --config-file=pyproject.toml diff --git a/toolkits/cursor_agents_api/arcade_cursor_agents_api/__init__.py b/toolkits/cursor_agents_api/arcade_cursor_agents_api/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/toolkits/cursor_agents_api/arcade_cursor_agents_api/tools/__init__.py b/toolkits/cursor_agents_api/arcade_cursor_agents_api/tools/__init__.py new file mode 100644 index 00000000..0e1c68c8 --- /dev/null +++ b/toolkits/cursor_agents_api/arcade_cursor_agents_api/tools/__init__.py @@ -0,0 +1,252 @@ +"""Arcade Starter Tools for Cursor_Agents + +DO NOT EDIT THIS MODULE DIRECTLY. + +THIS MODULE WAS AUTO-GENERATED BY TRANSPILING THE API STARTER TOOL JSON DEFINITIONS +IN THE ../wrapper_tools DIRECTORY INTO PYTHON CODE. ANY CHANGES TO THIS MODULE WILL +BE OVERWRITTEN BY THE TRANSPILER. +""" + +import asyncio +from typing import Annotated, Any + +import httpx +from arcade_tdk import ToolContext, tool + +# Retry configuration +INITIAL_RETRY_DELAY = 0.5 # seconds + +HTTP_CLIENT = httpx.AsyncClient( + timeout=httpx.Timeout(60.0, connect=10.0), + limits=httpx.Limits(max_keepalive_connections=20, max_connections=100), + transport=httpx.AsyncHTTPTransport(retries=3), + http2=True, + follow_redirects=True, +) + + +def remove_none_values(data: dict[str, Any]) -> dict[str, Any]: + return {k: v for k, v in data.items() if v is not None} + + +async def make_request( + url: str, + method: str, + params: dict[str, Any] | None = None, + headers: dict[str, Any] | None = None, + data: dict[str, Any] | None = None, + auth: tuple[str, str] | None = None, + max_retries: int = 3, +) -> httpx.Response: + """Make an HTTP request with retry logic for 5xx server errors.""" + for attempt in range(max_retries): + try: + response = await HTTP_CLIENT.request( + url=url, + auth=auth, + method=method, + params=params, + headers=headers, + data=data, + ) + response.raise_for_status() + except httpx.HTTPStatusError as e: + # Only retry on 5xx server errors + if e.response.status_code >= 500 and attempt < max_retries - 1: + # Exponential backoff: 0.5s, 1s, 2s + await asyncio.sleep(INITIAL_RETRY_DELAY * (2**attempt)) + continue + # Re-raise for 4xx errors or if max retries reached + raise + except httpx.RequestError: + # Don't retry request errors (network issues are handled by transport) + raise + else: + return response + + # This should never be reached, but satisfies type checker + raise httpx.RequestError("Max retries exceeded") # noqa: TRY003 + + +@tool(requires_secrets=["CURSOR_AGENTS_API_KEY"]) +async def list_background_agents( + context: ToolContext, + agent_limit: Annotated[ + int | None, "Number of background agents to return for the request." + ] = 20, + pagination_cursor: Annotated[ + str | None, "Pagination cursor from the previous response to navigate pages." + ] = None, +) -> Annotated[dict[str, Any], "Response from the API endpoint 'listAgents'."]: + """List all background agents for the user. + + Use this tool to retrieve a list of all background agents associated with the authenticated user.""" # noqa: E501 + response = await make_request( + url="https://api.cursor.com/v0/agents", + method="GET", + params=remove_none_values({"limit": agent_limit, "cursor": pagination_cursor}), + headers=remove_none_values({ + "Authorization": "Bearer {authorization}".format( + authorization=context.get_secret("CURSOR_AGENTS_API_KEY") + ) + }), + data=remove_none_values({}), + ) + try: + return {"response_json": response.json()} + except Exception: + return {"response_text": response.text} + + +@tool(requires_secrets=["CURSOR_AGENTS_API_KEY"]) +async def get_agent_status( + context: ToolContext, + background_agent_id: Annotated[ + str, + "A unique identifier required to retrieve the status and results of the specified background agent.", # noqa: E501 + ], +) -> Annotated[dict[str, Any], "Response from the API endpoint 'getAgent'."]: + """Retrieve the current status and results of a background agent. + + Call this tool to get information about the status and results of a specific background agent by providing its ID.""" # noqa: E501 + response = await make_request( + url="https://api.cursor.com/v0/agents/{id}".format(id=background_agent_id), # noqa: UP032 + method="GET", + params=remove_none_values({}), + headers=remove_none_values({ + "Authorization": "Bearer {authorization}".format( + authorization=context.get_secret("CURSOR_AGENTS_API_KEY") + ) + }), + data=remove_none_values({}), + ) + try: + return {"response_json": response.json()} + except Exception: + return {"response_text": response.text} + + +@tool(requires_secrets=["CURSOR_AGENTS_API_KEY"]) +async def delete_background_agent( + context: ToolContext, + background_agent_id: Annotated[ + str, "Unique identifier for the background agent to be deleted permanently." + ], +) -> Annotated[dict[str, Any], "Response from the API endpoint 'deleteAgent'."]: + """Permanently delete a background agent. + + This tool is used to permanently delete a background agent. This action cannot be undone, so it should be called with caution when you need to remove an agent completely.""" # noqa: E501 + response = await make_request( + url="https://api.cursor.com/v0/agents/{id}".format(id=background_agent_id), # noqa: UP032 + method="DELETE", + params=remove_none_values({}), + headers=remove_none_values({ + "Authorization": "Bearer {authorization}".format( + authorization=context.get_secret("CURSOR_AGENTS_API_KEY") + ) + }), + data=remove_none_values({}), + ) + try: + return {"response_json": response.json()} + except Exception: + return {"response_text": response.text} + + +@tool(requires_secrets=["CURSOR_AGENTS_API_KEY"]) +async def get_agent_conversation_history( + context: ToolContext, + background_agent_id: Annotated[ + str, "Unique identifier for the background agent to retrieve conversation history." + ], +) -> Annotated[dict[str, Any], "Response from the API endpoint 'getAgentConversation'."]: + """Retrieve the conversation history of a background agent. + + This tool retrieves the full conversation history, including user prompts and assistant responses, for a specified background agent. It is useful for reviewing past interactions and understanding agent behavior.""" # noqa: E501 + response = await make_request( + url="https://api.cursor.com/v0/agents/{id}/conversation".format(id=background_agent_id), # noqa: UP032 + method="GET", + params=remove_none_values({}), + headers=remove_none_values({ + "Authorization": "Bearer {authorization}".format( + authorization=context.get_secret("CURSOR_AGENTS_API_KEY") + ) + }), + data=remove_none_values({}), + ) + try: + return {"response_json": response.json()} + except Exception: + return {"response_text": response.text} + + +@tool(requires_secrets=["CURSOR_AGENTS_API_KEY"]) +async def retrieve_api_user_info( + context: ToolContext, +) -> Annotated[dict[str, Any], "Response from the API endpoint 'getMe'."]: + """Retrieve information about the API key used for authentication. + + This tool calls the endpoint to get details regarding the API key currently in use, including any relevant user information. It should be called when there is a need to verify or display details about the authentication being used.""" # noqa: E501 + response = await make_request( + url="https://api.cursor.com/v0/me", + method="GET", + params=remove_none_values({}), + headers=remove_none_values({ + "Authorization": "Bearer {authorization}".format( + authorization=context.get_secret("CURSOR_AGENTS_API_KEY") + ) + }), + data=remove_none_values({}), + ) + try: + return {"response_json": response.json()} + except Exception: + return {"response_text": response.text} + + +@tool(requires_secrets=["CURSOR_AGENTS_API_KEY"]) +async def list_recommended_models( + context: ToolContext, +) -> Annotated[dict[str, Any], "Response from the API endpoint 'listModels'."]: + """Retrieve recommended models for background agents. + + Use this tool to fetch a list of models recommended for use in background agent applications.""" + response = await make_request( + url="https://api.cursor.com/v0/models", + method="GET", + params=remove_none_values({}), + headers=remove_none_values({ + "Authorization": "Bearer {authorization}".format( + authorization=context.get_secret("CURSOR_AGENTS_API_KEY") + ) + }), + data=remove_none_values({}), + ) + try: + return {"response_json": response.json()} + except Exception: + return {"response_text": response.text} + + +@tool(requires_secrets=["CURSOR_AGENTS_API_KEY"]) +async def list_github_repositories( + context: ToolContext, +) -> Annotated[dict[str, Any], "Response from the API endpoint 'listRepositories'."]: + """Retrieve accessible GitHub repositories for a user. + + Use this tool to get a list of GitHub repositories that the authenticated user can access. It pulls data from the user's GitHub account and returns the repositories they have permission to view or modify.""" # noqa: E501 + response = await make_request( + url="https://api.cursor.com/v0/repositories", + method="GET", + params=remove_none_values({}), + headers=remove_none_values({ + "Authorization": "Bearer {authorization}".format( + authorization=context.get_secret("CURSOR_AGENTS_API_KEY") + ) + }), + data=remove_none_values({}), + ) + try: + return {"response_json": response.json()} + except Exception: + return {"response_text": response.text} diff --git a/toolkits/cursor_agents_api/arcade_cursor_agents_api/wrapper_tools/DeleteBackgroundAgent.json b/toolkits/cursor_agents_api/arcade_cursor_agents_api/wrapper_tools/DeleteBackgroundAgent.json new file mode 100644 index 00000000..606699c6 --- /dev/null +++ b/toolkits/cursor_agents_api/arcade_cursor_agents_api/wrapper_tools/DeleteBackgroundAgent.json @@ -0,0 +1,101 @@ +{ + "name": "DeleteBackgroundAgent", + "fully_qualified_name": "CursorAgentsApi.DeleteBackgroundAgent@0.1.0", + "description": "Permanently delete a background agent.\n\nThis tool is used to permanently delete a background agent. This action cannot be undone, so it should be called with caution when you need to remove an agent completely.", + "toolkit": { + "name": "ArcadeCursorAgentsApi", + "description": null, + "version": "0.1.0" + }, + "input": { + "parameters": [ + { + "name": "background_agent_id", + "required": true, + "description": "Unique identifier for the background agent to be deleted permanently.", + "value_schema": { + "val_type": "string", + "inner_val_type": null, + "enum": null, + "properties": null, + "inner_properties": null, + "description": "Unique identifier for the background agent" + }, + "inferrable": true, + "http_endpoint_parameter_name": "id" + } + ] + }, + "output": { + "description": "Response from the API endpoint 'deleteAgent'.", + "available_modes": [ + "value", + "error", + "null" + ], + "value_schema": { + "val_type": "json", + "inner_val_type": null, + "enum": null, + "properties": null, + "inner_properties": null, + "description": null + } + }, + "requirements": { + "authorization": null, + "secrets": [ + { + "key": "CURSOR_AGENTS_API_KEY" + } + ], + "metadata": null + }, + "deprecation_message": null, + "metadata": { + "object_type": "api_wrapper_tool", + "version": "1.0.0", + "description": "Tools that enable LLMs to interact directly with the cursor_agents API." + }, + "http_endpoint": { + "metadata": { + "object_type": "http_endpoint", + "version": "1.1.0", + "description": "" + }, + "url": "https://api.cursor.com/v0/agents/{id}", + "http_method": "DELETE", + "headers": {}, + "parameters": [ + { + "name": "id", + "tool_parameter_name": "background_agent_id", + "description": "Unique identifier for the background agent", + "value_schema": { + "val_type": "string", + "inner_val_type": null, + "enum": null, + "properties": null, + "inner_properties": null, + "description": "Unique identifier for the background agent" + }, + "accepted_as": "path", + "required": true, + "deprecated": false, + "default": null, + "documentation_urls": [] + } + ], + "documentation_urls": [], + "secrets": [ + { + "arcade_key": "CURSOR_AGENTS_API_KEY", + "parameter_name": "Authorization", + "accepted_as": "header", + "formatted_value": "Bearer {authorization}", + "description": "", + "is_auth_token": false + } + ] + } +} diff --git a/toolkits/cursor_agents_api/arcade_cursor_agents_api/wrapper_tools/GetAgentConversationHistory.json b/toolkits/cursor_agents_api/arcade_cursor_agents_api/wrapper_tools/GetAgentConversationHistory.json new file mode 100644 index 00000000..a8a87646 --- /dev/null +++ b/toolkits/cursor_agents_api/arcade_cursor_agents_api/wrapper_tools/GetAgentConversationHistory.json @@ -0,0 +1,101 @@ +{ + "name": "GetAgentConversationHistory", + "fully_qualified_name": "CursorAgentsApi.GetAgentConversationHistory@0.1.0", + "description": "Retrieve the conversation history of a background agent.\n\nThis tool retrieves the full conversation history, including user prompts and assistant responses, for a specified background agent. It is useful for reviewing past interactions and understanding agent behavior.", + "toolkit": { + "name": "ArcadeCursorAgentsApi", + "description": null, + "version": "0.1.0" + }, + "input": { + "parameters": [ + { + "name": "background_agent_id", + "required": true, + "description": "Unique identifier for the background agent to retrieve conversation history.", + "value_schema": { + "val_type": "string", + "inner_val_type": null, + "enum": null, + "properties": null, + "inner_properties": null, + "description": "Unique identifier for the background agent" + }, + "inferrable": true, + "http_endpoint_parameter_name": "id" + } + ] + }, + "output": { + "description": "Response from the API endpoint 'getAgentConversation'.", + "available_modes": [ + "value", + "error", + "null" + ], + "value_schema": { + "val_type": "json", + "inner_val_type": null, + "enum": null, + "properties": null, + "inner_properties": null, + "description": null + } + }, + "requirements": { + "authorization": null, + "secrets": [ + { + "key": "CURSOR_AGENTS_API_KEY" + } + ], + "metadata": null + }, + "deprecation_message": null, + "metadata": { + "object_type": "api_wrapper_tool", + "version": "1.0.0", + "description": "Tools that enable LLMs to interact directly with the cursor_agents API." + }, + "http_endpoint": { + "metadata": { + "object_type": "http_endpoint", + "version": "1.1.0", + "description": "" + }, + "url": "https://api.cursor.com/v0/agents/{id}/conversation", + "http_method": "GET", + "headers": {}, + "parameters": [ + { + "name": "id", + "tool_parameter_name": "background_agent_id", + "description": "Unique identifier for the background agent", + "value_schema": { + "val_type": "string", + "inner_val_type": null, + "enum": null, + "properties": null, + "inner_properties": null, + "description": "Unique identifier for the background agent" + }, + "accepted_as": "path", + "required": true, + "deprecated": false, + "default": null, + "documentation_urls": [] + } + ], + "documentation_urls": [], + "secrets": [ + { + "arcade_key": "CURSOR_AGENTS_API_KEY", + "parameter_name": "Authorization", + "accepted_as": "header", + "formatted_value": "Bearer {authorization}", + "description": "", + "is_auth_token": false + } + ] + } +} diff --git a/toolkits/cursor_agents_api/arcade_cursor_agents_api/wrapper_tools/GetAgentStatus.json b/toolkits/cursor_agents_api/arcade_cursor_agents_api/wrapper_tools/GetAgentStatus.json new file mode 100644 index 00000000..744c3c68 --- /dev/null +++ b/toolkits/cursor_agents_api/arcade_cursor_agents_api/wrapper_tools/GetAgentStatus.json @@ -0,0 +1,101 @@ +{ + "name": "GetAgentStatus", + "fully_qualified_name": "CursorAgentsApi.GetAgentStatus@0.1.0", + "description": "Retrieve the current status and results of a background agent.\n\nCall this tool to get information about the status and results of a specific background agent by providing its ID.", + "toolkit": { + "name": "ArcadeCursorAgentsApi", + "description": null, + "version": "0.1.0" + }, + "input": { + "parameters": [ + { + "name": "background_agent_id", + "required": true, + "description": "A unique identifier required to retrieve the status and results of the specified background agent.", + "value_schema": { + "val_type": "string", + "inner_val_type": null, + "enum": null, + "properties": null, + "inner_properties": null, + "description": "Unique identifier for the background agent" + }, + "inferrable": true, + "http_endpoint_parameter_name": "id" + } + ] + }, + "output": { + "description": "Response from the API endpoint 'getAgent'.", + "available_modes": [ + "value", + "error", + "null" + ], + "value_schema": { + "val_type": "json", + "inner_val_type": null, + "enum": null, + "properties": null, + "inner_properties": null, + "description": null + } + }, + "requirements": { + "authorization": null, + "secrets": [ + { + "key": "CURSOR_AGENTS_API_KEY" + } + ], + "metadata": null + }, + "deprecation_message": null, + "metadata": { + "object_type": "api_wrapper_tool", + "version": "1.0.0", + "description": "Tools that enable LLMs to interact directly with the cursor_agents API." + }, + "http_endpoint": { + "metadata": { + "object_type": "http_endpoint", + "version": "1.1.0", + "description": "" + }, + "url": "https://api.cursor.com/v0/agents/{id}", + "http_method": "GET", + "headers": {}, + "parameters": [ + { + "name": "id", + "tool_parameter_name": "background_agent_id", + "description": "Unique identifier for the background agent", + "value_schema": { + "val_type": "string", + "inner_val_type": null, + "enum": null, + "properties": null, + "inner_properties": null, + "description": "Unique identifier for the background agent" + }, + "accepted_as": "path", + "required": true, + "deprecated": false, + "default": null, + "documentation_urls": [] + } + ], + "documentation_urls": [], + "secrets": [ + { + "arcade_key": "CURSOR_AGENTS_API_KEY", + "parameter_name": "Authorization", + "accepted_as": "header", + "formatted_value": "Bearer {authorization}", + "description": "", + "is_auth_token": false + } + ] + } +} diff --git a/toolkits/cursor_agents_api/arcade_cursor_agents_api/wrapper_tools/ListBackgroundAgents.json b/toolkits/cursor_agents_api/arcade_cursor_agents_api/wrapper_tools/ListBackgroundAgents.json new file mode 100644 index 00000000..91237e09 --- /dev/null +++ b/toolkits/cursor_agents_api/arcade_cursor_agents_api/wrapper_tools/ListBackgroundAgents.json @@ -0,0 +1,134 @@ +{ + "name": "ListBackgroundAgents", + "fully_qualified_name": "CursorAgentsApi.ListBackgroundAgents@0.1.0", + "description": "List all background agents for the user.\n\nUse this tool to retrieve a list of all background agents associated with the authenticated user.", + "toolkit": { + "name": "ArcadeCursorAgentsApi", + "description": null, + "version": "0.1.0" + }, + "input": { + "parameters": [ + { + "name": "agent_limit", + "required": false, + "description": "Number of background agents to return for the request.", + "value_schema": { + "val_type": "integer", + "inner_val_type": null, + "enum": null, + "properties": null, + "inner_properties": null, + "description": "Number of background agents to return" + }, + "inferrable": true, + "http_endpoint_parameter_name": "limit" + }, + { + "name": "pagination_cursor", + "required": false, + "description": "Pagination cursor from the previous response to navigate pages.", + "value_schema": { + "val_type": "string", + "inner_val_type": null, + "enum": null, + "properties": null, + "inner_properties": null, + "description": "Pagination cursor from the previous response" + }, + "inferrable": true, + "http_endpoint_parameter_name": "cursor" + } + ] + }, + "output": { + "description": "Response from the API endpoint 'listAgents'.", + "available_modes": [ + "value", + "error", + "null" + ], + "value_schema": { + "val_type": "json", + "inner_val_type": null, + "enum": null, + "properties": null, + "inner_properties": null, + "description": null + } + }, + "requirements": { + "authorization": null, + "secrets": [ + { + "key": "CURSOR_AGENTS_API_KEY" + } + ], + "metadata": null + }, + "deprecation_message": null, + "metadata": { + "object_type": "api_wrapper_tool", + "version": "1.0.0", + "description": "Tools that enable LLMs to interact directly with the cursor_agents API." + }, + "http_endpoint": { + "metadata": { + "object_type": "http_endpoint", + "version": "1.1.0", + "description": "" + }, + "url": "https://api.cursor.com/v0/agents", + "http_method": "GET", + "headers": {}, + "parameters": [ + { + "name": "limit", + "tool_parameter_name": "agent_limit", + "description": "Number of background agents to return", + "value_schema": { + "val_type": "integer", + "inner_val_type": null, + "enum": null, + "properties": null, + "inner_properties": null, + "description": "Number of background agents to return" + }, + "accepted_as": "query", + "required": false, + "deprecated": false, + "default": 20, + "documentation_urls": [] + }, + { + "name": "cursor", + "tool_parameter_name": "pagination_cursor", + "description": "Pagination cursor from the previous response", + "value_schema": { + "val_type": "string", + "inner_val_type": null, + "enum": null, + "properties": null, + "inner_properties": null, + "description": "Pagination cursor from the previous response" + }, + "accepted_as": "query", + "required": false, + "deprecated": false, + "default": null, + "documentation_urls": [] + } + ], + "documentation_urls": [], + "secrets": [ + { + "arcade_key": "CURSOR_AGENTS_API_KEY", + "parameter_name": "Authorization", + "accepted_as": "header", + "formatted_value": "Bearer {authorization}", + "description": "", + "is_auth_token": false + } + ] + } +} diff --git a/toolkits/cursor_agents_api/arcade_cursor_agents_api/wrapper_tools/ListGithubRepositories.json b/toolkits/cursor_agents_api/arcade_cursor_agents_api/wrapper_tools/ListGithubRepositories.json new file mode 100644 index 00000000..a4259f49 --- /dev/null +++ b/toolkits/cursor_agents_api/arcade_cursor_agents_api/wrapper_tools/ListGithubRepositories.json @@ -0,0 +1,66 @@ +{ + "name": "ListGithubRepositories", + "fully_qualified_name": "CursorAgentsApi.ListGithubRepositories@0.1.0", + "description": "Retrieve accessible GitHub repositories for a user.\n\nUse this tool to get a list of GitHub repositories that the authenticated user can access. It pulls data from the user's GitHub account and returns the repositories they have permission to view or modify.", + "toolkit": { + "name": "ArcadeCursorAgentsApi", + "description": null, + "version": "0.1.0" + }, + "input": { + "parameters": [] + }, + "output": { + "description": "Response from the API endpoint 'listRepositories'.", + "available_modes": [ + "value", + "error", + "null" + ], + "value_schema": { + "val_type": "json", + "inner_val_type": null, + "enum": null, + "properties": null, + "inner_properties": null, + "description": null + } + }, + "requirements": { + "authorization": null, + "secrets": [ + { + "key": "CURSOR_AGENTS_API_KEY" + } + ], + "metadata": null + }, + "deprecation_message": null, + "metadata": { + "object_type": "api_wrapper_tool", + "version": "1.0.0", + "description": "Tools that enable LLMs to interact directly with the cursor_agents API." + }, + "http_endpoint": { + "metadata": { + "object_type": "http_endpoint", + "version": "1.1.0", + "description": "" + }, + "url": "https://api.cursor.com/v0/repositories", + "http_method": "GET", + "headers": {}, + "parameters": [], + "documentation_urls": [], + "secrets": [ + { + "arcade_key": "CURSOR_AGENTS_API_KEY", + "parameter_name": "Authorization", + "accepted_as": "header", + "formatted_value": "Bearer {authorization}", + "description": "", + "is_auth_token": false + } + ] + } +} diff --git a/toolkits/cursor_agents_api/arcade_cursor_agents_api/wrapper_tools/ListRecommendedModels.json b/toolkits/cursor_agents_api/arcade_cursor_agents_api/wrapper_tools/ListRecommendedModels.json new file mode 100644 index 00000000..c6cc8c2a --- /dev/null +++ b/toolkits/cursor_agents_api/arcade_cursor_agents_api/wrapper_tools/ListRecommendedModels.json @@ -0,0 +1,66 @@ +{ + "name": "ListRecommendedModels", + "fully_qualified_name": "CursorAgentsApi.ListRecommendedModels@0.1.0", + "description": "Retrieve recommended models for background agents.\n\nUse this tool to fetch a list of models recommended for use in background agent applications.", + "toolkit": { + "name": "ArcadeCursorAgentsApi", + "description": null, + "version": "0.1.0" + }, + "input": { + "parameters": [] + }, + "output": { + "description": "Response from the API endpoint 'listModels'.", + "available_modes": [ + "value", + "error", + "null" + ], + "value_schema": { + "val_type": "json", + "inner_val_type": null, + "enum": null, + "properties": null, + "inner_properties": null, + "description": null + } + }, + "requirements": { + "authorization": null, + "secrets": [ + { + "key": "CURSOR_AGENTS_API_KEY" + } + ], + "metadata": null + }, + "deprecation_message": null, + "metadata": { + "object_type": "api_wrapper_tool", + "version": "1.0.0", + "description": "Tools that enable LLMs to interact directly with the cursor_agents API." + }, + "http_endpoint": { + "metadata": { + "object_type": "http_endpoint", + "version": "1.1.0", + "description": "" + }, + "url": "https://api.cursor.com/v0/models", + "http_method": "GET", + "headers": {}, + "parameters": [], + "documentation_urls": [], + "secrets": [ + { + "arcade_key": "CURSOR_AGENTS_API_KEY", + "parameter_name": "Authorization", + "accepted_as": "header", + "formatted_value": "Bearer {authorization}", + "description": "", + "is_auth_token": false + } + ] + } +} diff --git a/toolkits/cursor_agents_api/arcade_cursor_agents_api/wrapper_tools/RetrieveApiUserInfo.json b/toolkits/cursor_agents_api/arcade_cursor_agents_api/wrapper_tools/RetrieveApiUserInfo.json new file mode 100644 index 00000000..a182491d --- /dev/null +++ b/toolkits/cursor_agents_api/arcade_cursor_agents_api/wrapper_tools/RetrieveApiUserInfo.json @@ -0,0 +1,66 @@ +{ + "name": "RetrieveApiUserInfo", + "fully_qualified_name": "CursorAgentsApi.RetrieveApiUserInfo@0.1.0", + "description": "Retrieve information about the API key used for authentication.\n\nThis tool calls the endpoint to get details regarding the API key currently in use, including any relevant user information. It should be called when there is a need to verify or display details about the authentication being used.", + "toolkit": { + "name": "ArcadeCursorAgentsApi", + "description": null, + "version": "0.1.0" + }, + "input": { + "parameters": [] + }, + "output": { + "description": "Response from the API endpoint 'getMe'.", + "available_modes": [ + "value", + "error", + "null" + ], + "value_schema": { + "val_type": "json", + "inner_val_type": null, + "enum": null, + "properties": null, + "inner_properties": null, + "description": null + } + }, + "requirements": { + "authorization": null, + "secrets": [ + { + "key": "CURSOR_AGENTS_API_KEY" + } + ], + "metadata": null + }, + "deprecation_message": null, + "metadata": { + "object_type": "api_wrapper_tool", + "version": "1.0.0", + "description": "Tools that enable LLMs to interact directly with the cursor_agents API." + }, + "http_endpoint": { + "metadata": { + "object_type": "http_endpoint", + "version": "1.1.0", + "description": "" + }, + "url": "https://api.cursor.com/v0/me", + "http_method": "GET", + "headers": {}, + "parameters": [], + "documentation_urls": [], + "secrets": [ + { + "arcade_key": "CURSOR_AGENTS_API_KEY", + "parameter_name": "Authorization", + "accepted_as": "header", + "formatted_value": "Bearer {authorization}", + "description": "", + "is_auth_token": false + } + ] + } +} diff --git a/toolkits/cursor_agents_api/pyproject.toml b/toolkits/cursor_agents_api/pyproject.toml new file mode 100644 index 00000000..4bc15379 --- /dev/null +++ b/toolkits/cursor_agents_api/pyproject.toml @@ -0,0 +1,60 @@ +[build-system] +requires = [ "hatchling",] +build-backend = "hatchling.build" + +[project] +name = "arcade_cursor_agents_api" +version = "0.1.0" +description = "Tools that enable LLMs to interact directly with the Cursor Background Agents API." +requires-python = ">=3.10" +dependencies = [ + "arcade-tdk>=2.0.0,<4.0.0", + "httpx[http2]>=0.27.2,<1.0.0", +] +[[project.authors]] +email = "support@arcade.dev" + + +[project.optional-dependencies] +dev = [ + "arcade-mcp[all]>=1.2.0,<2.0.0", + "arcade-serve>=2.0.0,<4.0.0", + "pytest>=8.3.0,<8.4.0", + "pytest-cov>=4.0.0,<4.1.0", + "pytest-mock>=3.11.1,<3.12.0", + "pytest-asyncio>=0.24.0,<0.25.0", + "mypy>=1.5.1,<1.6.0", + "pre-commit>=3.4.0,<3.5.0", + "tox>=4.11.1,<4.12.0", + "ruff>=0.7.4,<0.8.0", +] + +# Tell Arcade.dev that this package is a toolkit +[project.entry-points.arcade_toolkits] +toolkit_name = "arcade_cursor_agents_api" + +# Use local path sources for arcade libs when working locally +[tool.uv.sources] +arcade-mcp = { path = "../../", editable = true } +arcade-serve = { path = "../../libs/arcade-serve/", editable = true } +arcade-tdk = { path = "../../libs/arcade-tdk/", editable = true } +[tool.mypy] +files = [ "arcade_cursor_agents_api/**/*.py",] +python_version = "3.10" +disallow_untyped_defs = "True" +disallow_any_unimported = "True" +no_implicit_optional = "True" +check_untyped_defs = "True" +warn_return_any = "True" +warn_unused_ignores = "True" +show_error_codes = "True" +ignore_missing_imports = "True" + +[tool.pytest.ini_options] +testpaths = [ "tests",] + +[tool.coverage.report] +skip_empty = true + +[tool.hatch.build.targets.wheel] +packages = [ "arcade_cursor_agents_api",] diff --git a/toolkits/cursor_agents_api/tests/__init__.py b/toolkits/cursor_agents_api/tests/__init__.py new file mode 100644 index 00000000..e69de29b