planetscale_execute_read_query
ChatGPTExecute a read-only SQL query against a PlanetScale database. Write operations are rejected by the database role. This tool creates short-lived credentials and executes the query securely. Queries have a maximum execution time of 50 seconds — if a query exceeds this limit it will be cancelled, so ensure queries are optimized. For Postgres and Neki, this tool uses an ephemeral pg_read_all_data role that does not bypass row-level security (RLS); zero-row or zero-count results on RLS-protected tables may mean rows are hidden by policy, and the response may include warnings when that risk is detected. For Postgres and Neki only: optionally specify postgres_database_name when the user wants to query a non-default database.
planetscale_execute_write_query
ChatGPTExecute a write SQL query (INSERT, UPDATE, DELETE, or DDL) against a PlanetScale database. This tool creates short-lived credentials and executes the query securely. Queries have a maximum execution time of 50 seconds — if a query exceeds this limit it will be cancelled, so ensure queries are optimized. TRUNCATE is blocked. DELETE and UPDATE without WHERE clause are blocked. For Postgres and Neki only: use postgres_database_name when the user has created additional databases in the same cluster and wants to run the query against a non-default database. IMPORTANT: DELETE queries and DDL statements (CREATE, DROP, ALTER, RENAME) require human confirmation - you MUST ask the user for explicit approval before setting confirm_destructive: true. Never set confirm_destructive without first showing the user the exact query and getting their explicit 'yes' or approval.
planetscale_get_branch
ChatGPTGet details about a database branch
planetscale_get_branch_metrics
ChatGPTGet infrastructure metrics for a PlanetScale branch: CPU, memory, disk, replication lag, connections, PgBouncer, WAL, VTGate, and tablet health. The database kind selects the endpoint. Vitess uses tablet metrics; Postgres and Neki use branch metrics. view summary (the default) returns latest, min, avg, and max for a small health set plus current disk and connection values, without raw samples. Pod memory utilization includes page cache, so the summary also returns RSS and cache bytes. Vitess shard_storage_usage is percent full, not bytes. Use view series or instant and pass metrics to drill in. Series disk is planetscale_volume_usage_percentages; the current value is planetscale_volume_usage_percentage. Postgres and Neki names look like planetscale_primary_pods_cpu_util_percentages. Vitess tablet names are short, like primary_cpu_usage and replication_lag. Use get_insights for which queries are slow. Set include_points to return samples, at most 60 per series. Summary rolls per-pod series up to the busiest shard or role.
planetscale_get_branch_schema
ChatGPTGet the schema (tables, columns) for a database branch
planetscale_get_database
ChatGPTGet details about a specific database
planetscale_get_insights
ChatGPTGet query performance insights for a PlanetScale database branch. By default, aggregates the top queries across curated metrics (slowest, most time-consuming, most rows read, most inefficient, most rows affected, and highest egress) for a comprehensive view. Can also fetch queries sorted by a single metric. Supports filtering by tablet type (primary/replica). To drill down into a specific query pattern, first call without fingerprint to discover queries (each result includes a fingerprint and keyspace), then call again with both fingerprint and keyspace from that result to get the aggregated summary stats and individual executions. Note: egress_bytes and ingress_bytes values are raw bytes; the PlanetScale UI displays these as binary megabytes (1 MB = 2^20 bytes). Durations (sum_total_duration_millis) are in milliseconds. cpuTime is available for Postgres and Neki branches only; maxEgressBytes and ingressBytes/ingressBytesPerQuery/maxIngressBytes are available for MySQL/Vitess branches only. Default time window is the last 24 hours; from/to reaches back up to 365 days, but a range wider than 25 hours must be hour-aligned -- see the from/to descriptions. The individual executions in fingerprint mode are the exception: they are always limited to the last 25 hours, so a wider fingerprint call returns a full-range summary next to executions from the last 24 hours, and the response says so.
planetscale_get_invoice_line_items
ChatGPTGet all line items for an invoice. See prorated costs broken down by database branch. Including storage, egress bandwidth and development branches.
planetscale_get_organization
ChatGPTGet details about a specific organization
planetscale_get_organization_billing_payment_method
ChatGPTGet the current payment method for an organization
planetscale_get_payment_method_setup
ChatGPTGet a Stripe Checkout payment method setup started by update_payment_method. Use the setup_id returned by that tool; it is not a payment method ID. This is a one-time check and does not wait. If pending, give checkout_url to the customer and call this tool again only after they finish Checkout. If completed, this tool also returns the saved card brand, last four digits, expiration, and cardholder name as confirmation. Failed or expired setups cannot be resumed. Requires full access to the organization's payment method to inspect the setup and return the saved card.
planetscale_get_postgres_logs
ChatGPTFetch server logs for a PlanetScale Postgres or Neki database branch (not available for Vitess/MySQL databases). Returns recent log entries sorted newest first. Supports filtering by log level, time range, server role, and pod name, plus an optional raw LogsQL query for advanced filtering (e.g. word matching, field filters, and pipe stages like 'error | stats count()'). Default time window is the last hour.
planetscale_get_query_tag
ChatGPTFetch one query tag on a PlanetScale database branch, with its values and their query counts. Pass the id from list_query_tags, prefix included -- an unprefixed or unknown id returns a not-found error. Value entries carry the same kind ('literal', 'overflow', 'collapsed') as the listing. Use this to re-read a single tag's values under different filters -- a narrower time window, a specific fingerprint or keyspace, or literal_values_only -- without listing every tag on the branch again. Data comes from PlanetScale Insights. Default time window is the last 24 hours; from/to reaches back up to 365 days, but a range wider than 25 hours must be hour-aligned -- see the from/to descriptions.
planetscale_list_branches
ChatGPTList all branches within a databases
planetscale_list_cluster_sizes
ChatGPTList available PlanetScale cluster sizes (SKUs) for an organization and database engine, including Neki-specific PS-_NEKI sizes. PS- sizes use autoscaling network-backed storage; M-* sizes use super fast NVMe storage drives. The rate field is for an HA cluster with 2 replicas; replica_rate is for a single instance. Single instance databases are only available for Postgres. Metal instances must be HA.
planetscale_list_databases
ChatGPTList all databases within an organization
planetscale_list_invoices
ChatGPTList all invoices for an organization.
planetscale_list_organizations
ChatGPTList all PlanetScale organizations you have access to
planetscale_list_query_error_executions
ChatGPTList the individual captured query executions that failed with a given error fingerprint on a PlanetScale database branch. Each execution includes the normalized SQL, tables, keyspace, user, row counts, duration, error message, and query tags. Get an error_fingerprint from list_query_error_patterns first. This endpoint cannot filter by tablet type, so executions from all tablet types are returned even when the fingerprint came from a tablet-filtered pattern list. Data comes from PlanetScale Insights. Default time window is the last 24 hours. These results describe individual query executions, so unlike get_insights and the query tag tools the window is capped at 25 hours: a wider from/to falls back to the default window server-side.
planetscale_list_query_error_patterns
ChatGPTList failing queries for a PlanetScale database branch, aggregated by error fingerprint. Each pattern reports the error message, how many times it occurred, when it was last seen, and total/average duration. Use list_query_error_executions with an error_fingerprint from these results to see the individual failed executions behind a pattern. Data comes from PlanetScale Insights. Default time window is the last 24 hours. These results describe individual query executions, so unlike get_insights and the query tag tools the window is capped at 25 hours: a wider from/to falls back to the default window server-side.
planetscale_list_query_tag_summaries
ChatGPTBreak query statistics on a PlanetScale database branch down by query tag value -- total time, latency, rows read, and errors per application, route, job, or user. This is the tool that answers 'which part of my app is causing this load', as opposed to get_insights, which answers 'which query'. Pass one or more tag id values from list_query_tags in tags; several ids group by the combination of their values. Each row's dimensions maps the grouped tag ids to that row's values. Rows are sorted descending by sort_by (default 'totalTime'). A curated set of metrics is requested by default; fields widens or narrows it, and the response echoes the effective set as a map from each requested name to the key it is serialized under, since the two differ (count arrives as query_count). Metrics outside that set are stripped, so a 0 on a returned metric is a real measurement rather than an unrequested field. The sort_by metric is always included, whether or not it was asked for. dimension_counts reports how many matched queries had the grouping tag's value collapsed (collapsed_count) out of the total (total_count) -- those queries carry the tag, but their value was never recorded and cannot be recovered. Data comes from PlanetScale Insights. Default time window is the last 24 hours; from/to reaches back up to 365 days, but a range wider than 25 hours must be hour-aligned -- see the from/to descriptions.
planetscale_list_query_tags
ChatGPTList the query tags seen on a PlanetScale database branch's queries, with their values and query counts. Query tags are SQLCommenter-style annotations an application attaches in SQL comments (e.g. 'app', 'controller', 'route'), plus dimensions Insights derives from the connection itself (e.g. 'username', 'application_name'). Start here: the id values this returns are the only way to reach get_query_tag and list_query_tag_summaries, which is where query load actually gets attributed to a tag value. Each id keeps a one-character origin prefix -- 'S' for a tag the application submitted in a SQL comment (source: 'sql'), 'B' for one Insights captured itself (source: 'system') -- and name is the same id with the prefix stripped. Each value entry carries a kind: 'literal' is a real recorded value; 'overflow' is the synthetic 'Other' bucket aggregating values ranked beyond values_limit; 'collapsed' is the synthetic 'Collapsed' bucket counting queries where Insights had stopped recording this tag's values because it saw too many distinct ones, so those values are unrecoverable rather than zero. Data comes from PlanetScale Insights. Default time window is the last 24 hours; from/to reaches back up to 365 days, but a range wider than 25 hours must be hour-aligned -- see the from/to descriptions.
planetscale_list_regions_for_organization
ChatGPTList the regions available for an organization.
planetscale_list_schema_recommendations
ChatGPTList all schema recommendations for a database. Each schema recommendation is based on production data from the users database. If you have access to the code base generating the queries, evaluate the code in the context of the recommendation to determine the best steps forward for the specific application. Use schema recommendations as a data point for improvement, not a directive. Suggestions include adding indexes, removing redundant indexes, preventing primary key exhaustion, unused tables and other general performance improvements. See https://planetscale.com/docs/postgres/monitoring/schema-recommendations for a full list as well as warnings of possible risks when making schema changes. Set state to "open" to retrieve only open recommendations.
planetscale_search_documentation
ChatGPTSearch across PlanetScale documentation and blog posts to find relevant information, code examples, API references, and guides. Use this tool when you need to answer questions about PlanetScale, find specific documentation, understand how features work, or locate implementation details. The search returns contextual content with titles and direct links to documentation pages and /blog posts.
planetscale_update_payment_method
ChatGPTStart a secure Stripe Checkout session to add or replace an organization's billing card. Use when a customer asks to add, set, replace, or update their PlanetScale payment method. This tool never collects card details: return checkout_url to the customer and let them complete Stripe Checkout in their browser. It returns a setup_id; do not call this tool again while that setup is pending. After the customer finishes, call get_payment_method_setup with the same organization and setup_id. Requires full access to the organization's payment method.
PlanetScale tools
ClaudeAccess to your PlanetScale organizations, databases, branches, schema, and Insights data.
planetscale_execute_read_query
Claudeplanetscale_execute_write_query
Claudeplanetscale_get_branch
Claudeplanetscale_get_branch_schema
Claudeplanetscale_get_database
Claudeplanetscale_get_insights
Claudeplanetscale_get_invoice_line_items
Claudeplanetscale_get_organization
Claudeplanetscale_list_branches
Claudeplanetscale_list_cluster_size_skus
Claudeplanetscale_list_databases
Claudeplanetscale_list_invoices
Claudeplanetscale_list_organizations
Claudeplanetscale_list_regions_for_organization
Claudeplanetscale_search_documentation
Claude