Skip to main content
Glama

delete_sip_account

Remove a SIP account from the didlogic_mcp server by specifying its name. Returns confirmation upon successful deletion.

Instructions

Delete a SIP account

Args: name: SIP account name

Returns a SIP Account deleted message on success

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesName of SIP account

Implementation Reference

  • The handler function decorated with @mcp.tool() that implements the logic for deleting a SIP account by issuing a DELETE request to the DidLogic API endpoint /v1/sipaccounts/{name} using the base helper, and returns a success message. Includes inline schema via Pydantic Field.
    @mcp.tool() async def delete_sip_account( ctx: Context, name: str | int = Field( description="Name of SIP account")) -> str: """ Delete a SIP account Args: name: SIP account name Returns a `SIP Account deleted` message on success """ await base.call_didlogic_api( ctx, "DELETE", f"/v1/sipaccounts/{name}" ) return "SIP Account deleted"
  • Registers the sip_accounts tools (including delete_sip_account) with the FastMCP server instance by calling the register_tools function defined in the module.
    tools.sip_accounts.register_tools(mcp)
  • Shared helper function that performs authenticated HTTP requests to the DidLogic API, handling both STDIO and HTTP/SSE transport modes by extracting or using the API key appropriately. Used by delete_sip_account to execute the DELETE request.
    async def call_didlogic_api( ctx: Context, method: str, path: str, params: Optional[Dict] = None, data: Optional[Dict] = None, json: Optional[Dict] = None ) -> httpx.Response: """ Make a call to the Didlogic API. In HTTP/SSE mode, extracts Bearer token from request context and adds it to the Authorization header for each API call. In STDIO mode, uses the API key already configured in the client headers. """ client = ctx.request_context.lifespan_context.client # In HTTP/SSE mode, get API key from request.state (set by middleware) extra_headers = {} # Check if we have a request object (indicates HTTP/SSE mode) request = getattr(ctx.request_context, "request", None) if request and hasattr(request, 'state') and hasattr(request.state, 'didlogic_api_key'): # HTTP/SSE mode: extract API key from request state api_key = request.state.didlogic_api_key if api_key: extra_headers["Authorization"] = f"Bearer {api_key}" logger.debug(f"Using API key from request state: {api_key[:8]}...") else: logger.warning("No API key found in request state") else: # STDIO mode: API key already in client headers from lifespan logger.debug("Using API key from client headers (STDIO mode)") response = await client.request( method=method, url=path, params=params, data=data, json=json, headers=extra_headers ) response.raise_for_status() return response

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/UserAd/didlogic_mcp'

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