Skip to main content
Glama

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)

Tools

Functions exposed to the LLM to take actions

NameDescription
start_authentication

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

get_login_instructions

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_authentication

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_status

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

reset_authentication

Clears the current authentication state and resets the session.

get_fund_limit

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

place_order

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

modify_order

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

cancel_order

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

get_order_book

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

get_order_by_id

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

get_order_by_correlation_id

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

get_trade_book

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

get_order_trades

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

place_super_order

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

modify_super_order

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

cancel_super_order_leg

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

get_super_order_book

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