Subsecuencia común más larga
longest-common-subsequenceEncuentra la subsecuencia común más larga de dos cadenas. Cuándo: hay que transformar, comparar o medir un texto con exactitud y no por aproximación. No para: calcular las diferencias línea por línea entre dos textos (diff-lines). Efectos secundarios: ninguno (solo lectura, sin red, sin estado guardado). Determinista: la misma entrada da la misma salida. Límites: entrada JSON de hasta 64 KB, 1 s por llamada, resultado de hasta 1 MB.
EN: Finds the longest common subsequence of two strings (by code point) and its length. Length product capped at 4M. When: text has to be transformed, compared or measured exactly instead of approximated. Not for: computing a line-by-line diff of two texts (diff-lines). Side effects: none (read-only, no network access, no stored state). Deterministic: the same input gives the same output. Limits: JSON input up to 64 KB, 1 s per call, result up to 1 MB.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"a": "<a>",
"b": "<b>"
},
"name": "longest-common-subsequence"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| a | Yes | First (string; required; up to 20000 chars). | |
| b | Yes | Second (string; required; up to 20000 chars). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| length | No | ||
| subsequence | No |