query

Thực hiện truy vấn CVM chỉ đọc trên mạng Convex. Sử dụng khi đọc trạng thái on-chain, kiểm tra số dư, tra cứu tài khoản hoặc đánh giá Convex Lisp…

npx skills add https://github.com/convex-dev/convex --skill query

Query Convex State

Queries are read-only, free and instant. They never modify state and need no key, so prefer a query over a transaction whenever you only need to read.

Expression: $0 Address (optional): $1 — the account context for the query (e.g. #13)

See the convex-lisp skill for CVM conventions and error codes.

How to Run It

With a Convex MCP server configured (tool names look like mcp__<server>__query), use its query tool. The server is configured per user, not by this repository — do not assume it is present.

Otherwise use the CLI, which always works from a built convex.jar:

java -jar convex.jar client query '(balance #13)'
java -jar convex.jar client query --host <host> --port <port> '(balance #13)'
java -jar convex.jar client query -a #13 '*balance*'

-a / --address sets the account context. Against a local network started with the local-network skill, pass --host localhost --port <PORT>.

Common Queries

TaskExpression
Coin balance(balance #13)
Own balance*balance*
Account info(account #13)
Token balance(@convex.fungible/balance #TOKEN #USER)
Token supply(@convex.fungible/total-supply #TOKEN)
Lookup symbol(lookup #ADDR 'symbol)
Full state*state* (large!)

lookup needs a literal symbol as its last argument — it is resolved at compile time, so a computed symbol fails with :COMPILE.

Present balances in CVM units (e.g. "1.5 CVM", not "1500000000 copper").

Thêm skills từ convex-dev

account
convex-dev
Tạo hoặc kiểm tra các account Convex. Sử dụng khi người dùng muốn thiết lập account mới, kiểm tra chi tiết account, hoặc quản lý keys.
account
convex-dev
Tạo hoặc kiểm tra tài khoản Convex. Sử dụng khi người dùng muốn thiết lập tài khoản mới, kiểm tra chi tiết tài khoản hoặc quản lý khóa.
token
convex-dev
Tạo và quản lý token có thể thay thế trên Convex. Sử dụng khi người dùng muốn tạo token mới, kiểm tra số dư token, hoặc quản lý nguồn cung token.
build-convex
convex-dev
Xây dựng dự án Convex từ mã nguồn. Sử dụng khi một người đóng góp muốn biên dịch, kiểm thử hoặc đóng gói Convex.
convex-db
convex-dev
Sử dụng Convex DB — cơ sở dữ liệu SQL hỗ trợ lattice. Sử dụng khi giúp người dùng viết truy vấn, kết nối qua JDBC hoặc máy khách PostgreSQL, tạo bảng, chèn/truy vấn dữ liệu,…
convex-lisp
convex-dev
Tài liệu tham khảo ngôn ngữ Convex Lisp — quy ước CVM, gọi mã thư viện, định nghĩa actor, mã juice và lỗi. Sử dụng khi viết hoặc gỡ lỗi mã nguồn CVM cho…
deploy
convex-dev
Triển khai một actor (hợp đồng thông minh) lên mạng Convex. Sử dụng khi người dùng muốn tạo một actor trên chuỗi mới với các hàm được xuất.
ecosystem
convex-dev
Định hướng trong hệ sinh thái Convex — thứ gì nằm trong repository nào, specs và docs ở đâu, và những thư viện client nào tồn tại. Sử dụng khi bạn cần ngữ cảnh…