Skip to main content
Glama
harshitdynamite

DhanHQ MCP Server

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
DHAN_API_KEYYesYour DhanHQ API key (valid for 12 months)
REDIRECT_URLYesThe redirect URL configured in your DhanHQ API settingshttp://localhost:3000/callback
DHAN_CLIENT_IDYesYour DhanHQ client ID
DHAN_API_SECRETYesYour DhanHQ API secret (valid for 12 months)

Capabilities

Server capabilities have not been inspected yet.

Tools

Functions exposed to the LLM to take actions

NameDescription
start_authenticationA

Initiates the DhanHQ authentication flow (Step 1). Returns a login URL that you must open in your browser to authenticate.

get_login_instructionsA

Gets the login instructions and URL for Step 2 (browser-based login). You must complete this step manually by opening the URL in your browser.

complete_authenticationA

Completes the authentication flow (Step 3). Takes the tokenId from the redirect URL after browser login and exchanges it for an access token.

check_auth_statusA

Checks the current authentication status and returns details about the active access token if available.

reset_authenticationB

Clears the current authentication state and resets the session.

get_fund_limitA

Retrieves account fund limit information including available balance, margins, collateral, and withdrawable balance. Requires authentication.

place_orderC

Places a new order on DhanHQ. Requires authentication. Supports MARKET, LIMIT, STOP_LOSS, and STOP_LOSS_MARKET orders.

modify_orderC

Modifies a pending order. Can change price, quantity, order type, and other parameters. Requires authentication.

cancel_orderA

Cancels a pending order. Requires authentication and a valid order ID.

get_order_bookB

Retrieves all orders placed during the day with their current status. Requires authentication.

get_order_by_idC

Retrieves the details and status of a specific order by order ID. Requires authentication.

get_order_by_correlation_idB

Retrieves order status using the user-specified correlation ID. Requires authentication.

get_trade_bookA

Retrieves all trades executed during the day. Useful for tracking fills and execution prices. Requires authentication.

get_order_tradesB

Retrieves all trades for a specific order. Useful for partial fills or bracket/cover orders. Requires authentication.

place_super_orderC

Places a smart super order combining entry, target, and stop-loss legs. Supports trailing stop loss. Requires authentication.

modify_super_orderC

Modifies any leg of a pending or part-traded super order. Requires authentication.

cancel_super_order_legB

Cancels a specific leg of a super order (ENTRY_LEG, TARGET_LEG, or STOP_LOSS_LEG). Requires authentication.

get_super_order_bookB

Retrieves all super orders placed during the day with nested leg details. Requires authentication.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

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/harshitdynamite/DhanMCP'

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